added 'RealPrice' dp to PriceEntryCommitControl, which updates the 'prospective price' if the control doesn't have KeyboardFocus
This commit is contained in:
1 parent
b968ebe492
commit
53ca6aade8
2 files changed
+14
No files matched your search
@@ -1167,6 +1167,7 @@ namespace mbts.spark {
|
||||
|
||||
public override FrameworkElement view_factory() {
|
||||
var price_up_down = new PriceEntryCommitControl();
|
||||
price_up_down.SetBinding(PriceEntryCommitControl.RealPriceProperty, new Binding(nameof(OrderBookRowVM.price)));
|
||||
price_up_down.SetBinding(PriceEntryCommitControl.SourceValueProperty, nameof(OrderBookRowVM.prospective_price));
|
||||
price_up_down.SetBinding(PriceEntryCommitControl.SourceContractSpecProperty, nameof(OrderBookRowVM.contract_spec));
|
||||
price_up_down.SetBinding(PriceEntryCommitControl.OnCommitProperty, nameof(OrderBookRowVM.modify_order_quantity_andor_price));
|
||||
|
||||
@@ -20,6 +20,19 @@ namespace mbts.ui.controls {
|
||||
/// Interaction logic for PriceEntryCommitControl.xaml
|
||||
/// </summary>
|
||||
public partial class PriceEntryCommitControl : UserControl {
|
||||
public static readonly DependencyProperty RealPriceProperty =
|
||||
WPFHelper.create_dp<double, PriceEntryCommitControl>(
|
||||
nameof(RealPrice),
|
||||
(o, v) => {
|
||||
if (!double.IsNaN(v) && !o.IsKeyboardFocusWithin)
|
||||
o.SetCurrentValue(SourceValueProperty, v);
|
||||
},
|
||||
double.NaN);
|
||||
|
||||
public double RealPrice {
|
||||
get => (double)GetValue(RealPriceProperty);
|
||||
set => SetValue(RealPriceProperty, value);
|
||||
}
|
||||
|
||||
|
||||
public static readonly DependencyProperty SourceValueProperty =
|
||||
|
||||
Reference in new issue
Block a user