| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System.Windows.Controls;
- using Muchinfo.MTPClient.Delivery.ViewModels;
- using System.Windows;
- using System.Windows.Input;
- using Xceed.Wpf.Toolkit;
- using Muchinfo.MTPClient.Infrastructure.Helpers;
- using Muchinfo.MTPClient.Data.Enums;
- using Muchinfo.MTPClient.Data.Model.Delivery;
- namespace Muchinfo.MTPClient.Delivery.Views
- {
- /// <summary>
- /// Description for DeliveryOrderView.
- /// </summary>
- public partial class DeliveryOrderView : Window
- {
- /// <summary>
- /// Initializes a new instance of the DeliveryOrderView class.
- /// </summary>
- public DeliveryOrderView()
- {
- InitializeComponent();
- this.DataContext = new DeliveryOrderViewModel();
- //MessengerHelper.DefaultRegister<int>(this, MessengerTokens.DeliveryBuyOrSellChanged, BuyOrSellChangedEvent);
- }
- public DeliveryOrderView(DeliveryOrderMessage info)
- {
- InitializeComponent();
- this.DataContext = new DeliveryOrderViewModel(info);
- }
- public void drag_MouseLeftButtonDown(object sender, MouseButtonEventArgs args)
- {
- this.DragMove();
- }
- public void CloseWindow(object sender, RoutedEventArgs args)
- {
- this.Close();
- }
- private void DecimalUpDown_KeyDown(object sender, KeyEventArgs e)
- {
- var txtInput = (DecimalUpDown)sender;
- if ((e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || (e.Key >= Key.D0 && e.Key <= Key.D9 ))
- {
- if (txtInput.Text.Length >= 6)
- {
- e.Handled = true;
- }
- else
- {
- e.Handled = false;
- }
-
- }
- else
- {
- e.Handled = true;
- }
- }
- }
- }
|