The third day I fight. Wrote the trigger for the button:

Style x:Key="SearchButtonStyle" TargetType="Button"> <Style.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter Property="Content" Value="ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ поиск"></Setter> </Trigger> </Style.Triggers> </Style> 

I use:

 <Button Name="FindApp" Content="Найти прилоТСния" Grid.Column="0" Grid.Row="3" Click="FindApp_Click" Style="{StaticResource SearchButtonStyle}"/> 

No reaction.

What can be wrong?

I set Content in Style:

 <Style x:Key="SearchButtonStyle" TargetType="{x:Type Button}"> <Setter Property="Tag" Value="true"/> <Setter Property="Content" Value="Найти прилоТСния"/> <Style.Triggers> <Trigger Property="Tag" Value="false"> <Setter Property="Content" Value="ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ поиск"></Setter> </Trigger> <Trigger Property="Tag" Value="true"> <Setter Property="Content" Value="Найти прилоТСния"></Setter> </Trigger> </Style.Triggers> </Style> <Button x:Name="FindApp" Grid.Column="0" Grid.Row="3" Click="FindApp_Click" Style="{StaticResource SearchButtonStyle}"/> 

    1 answer 1

    Initial Content must also be set via the style:

     <Grid> <Grid.Resources> <Style x:Key="FindAppButtonStyle" TargetType="{x:Type Button}"> <Setter Property="Content" Value="Найти прилоТСния"/> <Style.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter Property="Content" Value="ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ поиск"/> </Trigger> </Style.Triggers> </Style> </Grid.Resources> <Button Style="{StaticResource FindAppButtonStyle}"/> </Grid> 
    • All the same does not work - Sergey
    • @ Sergey: Should work. Did you remove Content="Найти прилоТСния" from your XAML? - VladD
    • Yes, I changed the trigger a little, but the essence has not changed, now I’ll throw the code. - Sergey
    • @ Sergey: For Tag does not work, because its type is object , not bool , so your Property="Tag" Value="true" value Property="Tag" Value="true" value was interpreted as the string "true" , not the value. Try to do exactly as recommended by the author of the answer. - VladD
    • @ Sergey: pastebin.com/t0WFHPir - VladD