将显示效果应用于InkToolbar [UWP]

时间:2017-08-11 17:20:44

标签: xaml uwp uwp-xaml

我尝试将显示效果应用于InkToolbar的按钮,但文档为自定义控件推荐的代码不起作用,这里是我添加的内容InkToolbar

的XAML代码
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="PointerOver">
                        <VisualState.Setters>
                            <Setter Target="RootGrid.(RevealBrushHelper.State)" Value="PointerOver" />
                            <Setter Target="RootGrid.Background" Value="{ThemeResource ButtonRevealBackgroundPointerOver}"/>
                            <Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ButtonRevealBorderBrushPointerOver}"/>
                            <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ButtonForegroundPointerOver}"/>
                        </VisualState.Setters>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <VisualState.Setters>
                            <Setter Target="RootGrid.(RevealBrushHelper.State)" Value="Pressed" />
                            <Setter Target="RootGrid.Background" Value="{ThemeResource ButtonRevealBackgroundPressed}"/>
                            <Setter Target="ContentPresenter.BorderBrush" Value="{ThemeResource ButtonRevealBorderBrushPressed}"/>
                            <Setter Target="ContentPresenter.Foreground" Value="{ThemeResource ButtonForegroundPressed}"/>
                        </VisualState.Setters>
                    </VisualState>
                </VisualStateGroup>
</VisualStateManager.VisualStateGroups> 

0 个答案:

没有答案