Is it possible to set x:Name on an object that is created from C#, so it can be targeted from Visual State Manager? #3699
Unanswered
VincentH-Net
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is possible in WPF with the WPF FrameworkElement.RegisterName method.
However I could not find an equivalent C# API in Windows App SDK. I also could not find an equivalent of the WPF Namescope class.
Is it possible?
E.g. in below XAML (from this SDK doc), if the
ButtonBrush
is created from C#, how can I target that brush from Visual State Manager XAML?This is a blocker for supporting Visual State Manager in C# Markup 2 for Windows App SDK
Note that if setting
x:Name
from C# is possible, it will also be possible to create theVisualStateManager.VisualStateGroups
from C#.Beta Was this translation helpful? Give feedback.
All reactions