42 lines
2.4 KiB
XML
42 lines
2.4 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:ctrl="clr-namespace:Elwig.Controls">
|
|
<Style TargetType="ctrl:UnitTextBox" BasedOn="{StaticResource {x:Type TextBox}}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ctrl:UnitTextBox">
|
|
<Border x:Name="Border"
|
|
BorderThickness="{Binding Path=BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
|
BorderBrush="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
|
SnapsToDevicePixels="True">
|
|
<Grid>
|
|
<ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Bottom">
|
|
<ScrollViewer.Margin>
|
|
<Binding ElementName="UnitBlock" Path="ActualWidth">
|
|
<Binding.Converter>
|
|
<ctrl:WidthToMarginConverter/>
|
|
</Binding.Converter>
|
|
</Binding>
|
|
</ScrollViewer.Margin>
|
|
</ScrollViewer>
|
|
<TextBlock x:Name="UnitBlock" Text="{Binding Path=Unit, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"
|
|
FontSize="10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3"/>
|
|
</Grid>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="LightGray"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="TextAlignment" Value="Right"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Foreground" Value="Gray"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ResourceDictionary>
|