Can not get Triggers to work #4848
-
I can not get the WinUI branch of the toolkit to build so I copied relevant XAML from this page verbatim to a sample app to try to test the functionality. I can not get the example to work. There are no error messages - the triggers do not fire. My repo with the sample app is here. I have a different but related problem to solve in my app so if I get this working I'll probably be back with another question. Here is a copy/paste of the XAML in the page cited above:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Nvm, I cloned your repro and it's a literal copy-paste :). @michael-hawker Any known issues that this trigger doesn't work in WinUI? |
Beta Was this translation helpful? Give feedback.
-
Does this code work on UWP? Like VSM is tricky to run within a page sometimes as it has to be on the root object (microsoft/microsoft-ui-xaml#5576). Though I could suspect that it could have something to do with Can you try putting everything in a Page and have your Window just contain that page? See microsoft/microsoft-ui-xaml#5515 I also have a new template which makes checking code against UWP and WinUI 3 a lot easier: https://github.com/michael-hawker/WinUI2plus3Template - Just include We should be pulling the Trigger code over in our first-wave of things when we start setting up our 8.0 code-base in the next couple of weeks, so we'll have these better tested across both platforms with examples as well. |
Beta Was this translation helpful? Give feedback.
Does this code work on UWP? Like VSM is tricky to run within a page sometimes as it has to be on the root object (microsoft/microsoft-ui-xaml#5576). Though I could suspect that it could have something to do with
Window
not being aFrameworkElement
here? That does cause issues elsewhere: microsoft/microsoft-ui-xaml#4966Can you try putting everything in a Page and have your Window just contain that page? See microsoft/microsoft-ui-xaml#5515
I also have a new template which makes checking code against UWP and WinUI 3 a lot easier: https://github.com/michael-hawker/WinUI2plus3Template - Just include
Microsoft.Toolkit.Uwp.UI
in the UWP head andCommunityToolkit.WinUI.UI
in the WindowsAppSDK o…