private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ClientAccount ca = this.DataContext as ClientAccount;
            this.Count = 1;

            ClientAccount ClientA = this.DataContext as ClientAccount;

            Binding b = new Binding();
            b.Path = new PropertyPath("Count");
            b.Source = this;
            b.Mode = BindingMode.TwoWay;
            b.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            b.NotifyOnValidationError = true;


            ValidationRule rule = new DoubleExactDivisionRule() 
            { Dividend = System.Convert.ToDouble(ClientA.TransactionSettings.OrderUnit),
                MinValue = ClientA.TransactionSettings.MinTrade, 
                MaxValue = ClientA.TransactionSettings.MaxTrade 
            };

            b.ValidationRules.Add(rule);
            this.IntCount.SetBinding(DoubleUpDown.ValueProperty, b);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            MarketOrderData data = this.DataContext as MarketOrderData;
            _orderChangedInfo.Count = data.OrderQuantity;
            Binding b = new Binding();
            b.Path = new PropertyPath("Count");
            b.Source = _orderChangedInfo;
            b.Mode = BindingMode.TwoWay;
            b.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
            b.NotifyOnValidationError = true;


            ValidationRule rule = new DoubleExactDivisionRule() { Dividend = data.Orderunit, MinValue = data.Orderunit, MaxValue = data.OrderQuantity };
            b.ValidationRules.Add(rule);
            this.DudCount.SetBinding(DoubleUpDown.ValueProperty, b);
        }