Answers for "wpf trigger"

C#
1

style trigger wpf

<TextBlock Text="Hello, styled world!" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center">
  <TextBlock.Style>
    <Style TargetType="TextBlock">
      <Setter Property="Foreground" Value="Blue"></Setter>
        <Style.Triggers>
        	<Trigger Property="IsMouseOver" Value="True">
        		<Setter Property="Foreground" Value="Red" />
        		<Setter Property="TextDecorations" Value="Underline" />
        	</Trigger>
      	</Style.Triggers>
    </Style>
  </TextBlock.Style>
</TextBlock>
Posted by: Guest on September-15-2020
1

wpf trigger

<Window x:Class="WpfTutorialSamples.Styles.StyleTriggersSample"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="StyleTriggersSample" Height="100" Width="300">
    <Grid>
        <TextBlock Text="Hello, styled world!" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Center">
            <TextBlock.Style>
                <Style TargetType="TextBlock">
                    <Setter Property="Foreground" Value="Blue"></Setter>
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Foreground" Value="Red" />
                            <Setter Property="TextDecorations" Value="Underline" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </TextBlock.Style>
        </TextBlock>
    </Grid>
</Window>
Posted by: Guest on August-04-2021

C# Answers by Framework

Browse Popular Code Answers by Language