-
Notifications
You must be signed in to change notification settings - Fork 0
/
EntryAmountControl.xaml
18 lines (18 loc) · 1.12 KB
/
EntryAmountControl.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<UserControl x:Class="Budget.EntryAmountControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Budget"
Height="48" Width="80">
<UserControl.Resources>
<local:CurrencyConverter x:Key="currencyConverter"/>
<local:CurrencyColorer x:Key="currencyColorer"/>
<local:AmountEnabledConverter x:Key="enabled"/>
</UserControl.Resources>
<Grid>
<local:CurrencyBox HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Width="80" BindingPath="BoundAmount"
IsEnabled="{Binding Converter={StaticResource enabled}, Mode=OneTime}"/>
<TextBlock HorizontalAlignment="Left" Margin="0,24,0,0" VerticalAlignment="Top" Width="80" Height="24"
Text="{Binding Sum, Converter={StaticResource currencyConverter}, ConverterParameter=showZero, Mode=OneWay}"
Foreground="{Binding Sum, Converter={StaticResource currencyColorer}, Mode=OneWay}" TextAlignment="Center"/>
</Grid>
</UserControl>