I want to enable 'Apply' dialog button when content of some textboxes in this dialog changes.
Here what I came up with
<Window.Resources>
<ResourceDictionary>
...
<Style x:Key="SettingTextBoxStyle" TargetType="{x:Type TextBox}">
<Style.Triggers>
<EventTrigger RoutedEvent="TextBox.TextChanged" >
<!-- I need something like this -->
<Setter Property="ApplyButton.IsEnabled" Value="True" />
</EventTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</Window.Resources>
<!-- in a galaxy far far away -->
<StackPanel>
...
<TextBox Style="{StaticResource SettingTextBoxStyle}" Text="{Binding Source={x:Static settings:Settings.Default}, Path=OutputFile}" />
</StackPanel>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="OK" Width="100" Click="OK_Click"/>
<Button Content="Cancel" Width="100" Click="Cancel_Click" />
<Button Content="Apply" Name="ApplyButton" Width="100" Click="Apply_Click"/>
</StackPanel>
How do I reach ApplyButton.IsEnabled property in my event trigger?
Should I instead all of this simply use same TextChanged event handler in back code? Or something else?