Skip to content

How to use the VisualStateManager from winrt/C++ ? #9727

Answered by lgztx96
michelgerritse asked this question in Q&A
Discussion options

You must be logged in to vote

Grid does not inherit from Microsoft::UI::Xaml::Controls::Control
https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.grid?view=windows-app-sdk-1.5

example:

<Window ...>
<Page x:Name="RootPage">  
    <Grid x:Name="AppRoot">
        <Grid x:Name="AppTitleBar" ...>
  </Grid>
 <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="WindowActivationStates">
                    <VisualState x:Name="Activated"/>
                    <VisualState x:Name="Deactivated">
                        <VisualState.Setters>
                            <Setter Target="TitleBarTextBlock.Foreground" Value="{ThemeResource WindowCaptionForeg…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@michelgerritse
Comment options

Answer selected by michelgerritse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants