using Muchinfo.MTPClient.Data.Enums;
using Muchinfo.MTPClient.Data.Helper;
using Muchinfo.MTPClient.Data.Model;
using Muchinfo.MTPClient.Data.Model.Account;
using Muchinfo.MTPClient.Trade.ViewModels.Unified;
using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using Xceed.Wpf.Toolkit;
namespace Muchinfo.MTPClient.Trade.Views
{
///
/// EntrustOrderFrame.xaml 的交互逻辑
///
public partial class EntrustOrderFrame : Window
{
public EntrustOrderFrame(QuoteGoods goods, Direction direction, ePriceMode priceMode = ePriceMode.PRICEMODE_MARKET)
{
InitializeComponent();
this.DataContext = new EntrustOrderViewModel(goods, direction, priceMode);
}
public EntrustOrderFrame(OrderBase orderBase, ePriceMode priceMode = ePriceMode.PRICEMODE_MARKET)
{
InitializeComponent();
this.DataContext = new EntrustOrderViewModel(orderBase, priceMode);
}
public EntrustOrderFrame()
{
InitializeComponent();
}
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
DragMove();
}
}
private void btnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
///
/// 使用new显示隐藏基类ShowDialog()方法
/// 把ShowDialog方法抛到UI线程(解决弹出下单界面后报价牌行情不跳问题)
///
new public void ShowDialog()
{
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
base.ShowDialog();
}));
}
private void DecimalUpDown_KeyDown(object sender, KeyEventArgs e)
{
if ((e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || (e.Key >= Key.D0 && e.Key <= Key.D9))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
private void Button_Click(object sender, RoutedEventArgs e)
{
//AppMessengerHelper.PopupNoticeMessage.Send(true);
}
}
}