-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIntegerTextBox.xaml
35 lines (35 loc) · 2.21 KB
/
IntegerTextBox.xaml
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
<UserControl x:Class="GraphicalMirai.IntegerTextBox"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:GraphicalMirai"
mc:Ignorable="d" Height="34"
d:DesignHeight="34" d:DesignWidth="100">
<Grid>
<TextBox x:Name="InputBox" Text="0" LostFocus="InputBox_LostFocus" PreviewTextInput="InputBox_PreviewTextInput" TextChanged="InputBox_TextChanged" Margin="0,0,22,0" Background="#FFF" Style="{StaticResource MaterialDesignOutlinedTextBox}" Padding="10,5,10,7" FontSize="16"/>
<Border x:Name="Buttons" Width="20" HorizontalAlignment="Right" CornerRadius="4" BorderThickness="1" BorderBrush="#000" ClipToBounds="True">
<Grid>
<Grid.OpacityMask>
<VisualBrush Visual="{Binding ElementName=mask}"/>
</Grid.OpacityMask>
<Grid.Resources>
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignFloatingActionMiniButton}">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Background" Value="#FFF"/>
<Setter Property="Foreground" Value="#000"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border x:Name="mask" Background="#FFF" CornerRadius="{Binding ElementName=Buttons,Path=CornerRadius}" />
<Button Grid.Row="0" Click="ButtonUp_Click" Content="{materialDesign:PackIcon Kind=ArrowUp}"/>
<Button Grid.Row="1" Click="ButtonDown_Click" Content="{materialDesign:PackIcon Kind=ArrowDown}"/>
</Grid>
</Border>
</Grid>
</UserControl>