need to add a converter so that tick-rounding behaves as expected; item 2 in case

This commit is contained in:
Jake Norbut committed 2019-02-13 09:14:02 -06:00
1 parent f6f9605a83
commit 0aea7e26f2
1 file changed
+5 -1
@@ -35,11 +35,15 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- we need this Converter here on Value b/c Value and TickDefaultValue are both being bound to SourceValue, -->
<!-- whereas in the OrderModificationControl Value and TickDefaultValue are both to different properties. I -->
<!-- believe this is why we initially observed the edit template sometimes tick-rounding to an incorrect -->
<!-- value; i.e. 14.895 was tick-rounded to 14.89 -->
<usp:PriceEntryControl x:Name="price_ticker"
Margin="0,0,2,0"
TickDefaultValue="{Binding SourceValue, ElementName=_me_price, Converter={StaticResource TickDefaultPriceConverter}, FallbackValue={u:Double 0}}"
ContractSpec="{Binding SourceContractSpec, ElementName=_me_price}"
Value="{Binding SourceValue, ElementName=_me_price}" />
Value="{Binding SourceValue, ElementName=_me_price, Converter={StaticResource TickDefaultPriceConverter}}" />
<Button Grid.Column="2" x:Name="commit_button" CommandParameter="{Binding Value, ElementName=price_ticker}" Command="{Binding OnCommit, ElementName=_me_price}" Content="✔" >
<Button.Style>
<Style TargetType="Button">