Пытаюсь добиться, что бы когда TextBox ставал IsEnable=False - принимал тот стиль, который я хочу Не могу понять, что делаю не так.
| Код | <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Rout.Task" x:Name="UserControl" Height="24.333" Width="300"> <UserControl.Resources> <Style x:Key="ControlStyle1" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Background" Value="{x:Null}"/> <Setter Property="BorderBrush" Value="{x:Null}"/> <Setter Property="Foreground" Value="Silver"/> <Setter Property="CaretBrush" Value="#FFDADADA"/> </Trigger> </Style.Triggers> </Style> </UserControl.Resources> <Grid x:Name="LayoutRoot" Margin="0"> <Grid.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FF3F3F3F" Offset="0"/> <GradientStop Color="#FF3B3B3B" Offset="1"/> <GradientStop Color="#FF1B1B1B" Offset="0.524"/> </LinearGradientBrush> </Grid.Background> <TextBox x:Name="u_TODO_Text" Margin="16.995,1.666,45.452,2.666" TextWrapping="Wrap" Text="TextBox" Height="20" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="Silver" CaretBrush="#FFDADADA" Style="{StaticResource ControlStyle1}"/> </Grid> </UserControl>
|
|