2026-01-26 18:56:53 +09:00

70 lines
4.0 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AuroraUIComponent.UserControls">
<Style x:Key="NumericTextBox" TargetType="TextBox">
<Setter Property="Margin" Value="2" />
<Setter Property="Height" Value="Auto" />
<Setter Property="FontSize" Value="14" />
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="#333337" />
<!--<Setter Property="Background" Value="#252525" />-->
<Setter Property="ContextMenu" Value="{DynamicResource MahApps.TextBox.ContextMenu.Aurora}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="#569DE5" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="BorderBrush" Value="#569DE5" />
</Trigger>
<Trigger Property="IsReadOnly" Value="True">
<Setter Property="Foreground" Value="RoyalBlue" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type local:UCNumericTextBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:UCNumericTextBox}">
<Grid x:Name="GridParent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding KeyTextWidth, RelativeSource={RelativeSource TemplatedParent}}" />
<ColumnDefinition Width="{Binding ValueTextWidth, RelativeSource={RelativeSource TemplatedParent}}" />
</Grid.ColumnDefinitions>
<Border x:Name="BorderKey" Margin="2" Background="{Binding KeyTextBgColor, RelativeSource={RelativeSource TemplatedParent}}">
<TextBlock
x:Name="TextKey"
Margin="5,0"
HorizontalAlignment="{Binding KeyHorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}"
FontSize="{Binding KeyTextSize, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{Binding KeyTextFgColor, RelativeSource={RelativeSource TemplatedParent}}"
Text="{Binding KeyText, RelativeSource={RelativeSource TemplatedParent}}" />
</Border>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border x:Name="ValueBorder" ToolTipService.InitialShowDelay="100">
<Border.ToolTip>
<ToolTip x:Name="TooltipRange" Visibility="Collapsed" />
</Border.ToolTip>
<TextBox x:Name="TextValue" Style="{StaticResource NumericTextBox}" />
</Border>
<TextBlock x:Name="TextUnit" Grid.Column="0" FontSize="11" HorizontalAlignment="Right" Margin="0 0 6 0" Foreground="#c0c0c0"
Text="{Binding Unit, RelativeSource={RelativeSource TemplatedParent}}"/>
<Button x:Name="ButtonMouse" Grid.Column="1" Margin="0 3" Padding="0"/>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>