Skip to content

How to use VisualStateManager to style a button? #9816

Answered by MartyIX
MartyIX asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you @castorix! It was still non-trivial for me to put together a working sample. So I decided to write a complete answer here for others to save some time.

<?xml version="1.0" encoding="utf-8"?>
<Window
    x:Class="WinUiDemos.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WinUiDemos"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">

        <StackPanel.Resource…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MartyIX
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