docs-maui
docs-maui copied to clipboard
C# examples not available
The docs say .NET Multi-platform App UI (.NET MAUI) triggers allow you to express actions declaratively in XAML that change the appearance of controls based on events or data changes. But why it can't be used with C# UI. If it can be then please add examples of C# UI too.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 4d235822-6844-24ce-55e7-2515d3c023b2
- Version Independent ID: 4d235822-6844-24ce-55e7-2515d3c023b2
- Content: Triggers - .NET MAUI
- Content Source: docs/fundamentals/triggers.md
- Product: dotnet-mobile
- Technology: dotnet-maui
- GitHub Login: @davidbritch
- Microsoft Alias: dabritch
Hi @HobDev
The whole point to triggers is making it easy to do things in XAML that would traditionally be accomplished in C#. So while you could use triggers in C#, there's often better ways of doing the same thing in C#. For example, an EventTrigger would be an event handler in C#. A DataTrigger would be code in a setter in C# etc.
Thanks @davidbritch for the information. Your above comment along with an example would be a great addition to the docs.