blob: 57bf3f6ff0a110cc4fc2fae865618993c843f8ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
<local:ParameterItemEditor
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Tango.SharedUI.Editors"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters"
x:Class="Tango.SharedUI.Editors.ParameterItemNumericUpDownEditor"
mc:Ignorable="d" d:DesignHeight="30" d:DesignWidth="150" Background="Transparent" BorderBrush="DimGray" BorderThickness="1">
<UserControl.Resources>
<converters:StringFormatConverter x:Key="StringFormatConverter"/>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="113*"/>
<ColumnDefinition Width="37*" MinWidth="30" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<RepeatButton x:Name="btnUp" Style="{x:Null}" Background="#151515" Click="btnUp_Click" Grid.Row="0" Padding="2" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type local:ParameterItemNumericUpDownEditor}}}">
<fa:ImageAwesome Icon="ArrowUp" Width="5" Height="5" Foreground="Gainsboro" />
</RepeatButton>
<RepeatButton x:Name="btnDown" Style="{x:Null}" Background="#151515" Click="btnDown_Click" Grid.Row="1" Padding="2" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type local:ParameterItemNumericUpDownEditor}}}">
<fa:ImageAwesome Icon="ArrowDown" Width="5" Height="5" Foreground="Gainsboro" />
</RepeatButton>
</Grid>
<Grid>
<TextBox x:Name="txtValue" KeyDown="txtValue_KeyDown" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource AncestorType={x:Type local:ParameterItemNumericUpDownEditor}}}" VerticalContentAlignment="Center" Background="Transparent" HorizontalContentAlignment="Center" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type local:ParameterItemNumericUpDownEditor}}}">
<MultiBinding Converter="{StaticResource StringFormatConverter}" Mode="TwoWay">
<Binding RelativeSource="{RelativeSource AncestorType={x:Type local:ParameterItemNumericUpDownEditor}}" Path="Value" Mode="TwoWay" />
<Binding RelativeSource="{RelativeSource AncestorType={x:Type local:ParameterItemNumericUpDownEditor}}" Path="Format"/>
</MultiBinding>
</TextBox>
</Grid>
</Grid>
</local:ParameterItemEditor>
|