A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
Expander foreground property does not work while adding the header into the TextBlock in WPF
I am trying to use the textblock for the expander header property to visualize the text properly. But the foreground property doesnt update because trigger fails to update for the Is Pressed property while using the textblock. If I gave the header content directly it works perfectly fine. Here I am providing the comparison between the two codes.
Expander header with TextBlock:
<Expander Margin="5" x:Name="expander">
<Expander.Header>
<TextBlock
Margin="4"
FontSize="12"
FontWeight="Bold"
Text="WPF" />
</Expander.Header>
<TextBlock TextWrapping="Wrap" Margin="10">
Windows Presentation Foundation (WPF) is a UI framework that creates desktop client applications. The WPF development platform supports a broad set of application development features, including an application model, resources, controls, graphics, layout, data binding, documents, and security. The framework is part of .NET, so if you have previously built applications with .NET using ASP.NET or Windows Forms, the programming experience should be familiar. WPF uses the Extensible Application Markup Language (XAML) to provide a declarative model for application programming.
</TextBlock>
</Expander>
Expander Header without TextBlock:
<Expander Margin="5" x:Name="expander" Header="WPF">
<TextBlock TextWrapping="Wrap" Margin="10">
Windows Presentation Foundation (WPF) is a UI framework that creates desktop client applications. The WPF development platform supports a broad set of application development features, including an application model, resources, controls, graphics, layout, data binding, documents, and security. The framework is part of .NET, so if you have previously built applications with .NET using ASP.NET or Windows Forms, the programming experience should be familiar. WPF uses the Extensible Application Markup Language (XAML) to provide a declarative model for application programming.
</TextBlock>
</Expander>
So please provide me a solution for this issue.
Regards,
Hari Prasad