Replies: 3 comments 4 replies
-
My experience was that XAML at one point started making sense. Might just be that I'm used to it now. When searching for solutions make sure to add either "uwp" or "winui" in the query. Hot Reload on XAML can be finicky sometimes, but it does work. I did notice, however, that setting the x:Load property makes them not change. Don't know if it's a bug. |
Beta Was this translation helpful? Give feedback.
-
As an aside, given the XAML online documentation situation, what is the impact on AI responses and example code to questions regarding XAML? Something to consider as well when using XAML and AI assistance. |
Beta Was this translation helpful? Give feedback.
-
The designer was quite useful for this, sadly WinUI 3 doesn't have one. I agree that this could use some improvement, adding property docs to the XAML Intellisense would be wonderful too.
I haven't found this to be an issue - a more concrete example could be nice.
I agree that the UWP+WinUI 2 and WinUI 3 documentation split was handled very badly, and needs improvement. But only those two, WPF documentation was never really an issue.
My guess is, about as much of a problem as "How to show a button using Swift?" would be on Apple platforms. So probably none, unless you're blindly trusting the LLM or can't tell the difference between UIKit and SwiftUI.
Visual Studio usually tells you why hot reload is failing - sometimes it fails for seemingly no reason though, it needs improvement, I agree. A designer would fix this entirely, and you can use one with UWP ;)
Are you moving them from within Visual Studio, or the explorer? If you're doing it the second way, that won't properly update the project files - XAML files in particular go through the XAML compiler task, so they're explicitly referenced in your .csproj, which Visual Studio will update on its own, but won't work if done from the explorer. Same applies if you're moving the whole project directory, because the solution file references those.
Some of the technical aspects & benefits are pretty nicely explained here, in my opinion: #4127 (comment) Subjectively, I'd argue writing XAML is a much better experience. You can already create your window and controls in C# if you really want to, but C# isn't designed to do UI, and WinUI isn't designed to be used without XAML. Example from that same thread, and not even using more advanced features like attached properties, events, behaviors, or design time data: <A b="c" d="e">
<B f="g" h="i">
<C j="k" l="m"></C>
</B>
</A> A a = new A() { b: "c", d: "e", _: new B()
{ f: "g", h: "i", _: new C()
{ j: "k", l: "m"
}
}
} |
Beta Was this translation helpful? Give feedback.
-
I have been learning WinUI app development using XAML.
For context, my comments are from the perspective of a beginner in terms of Windows app development. My experiments were using the VS 2022 template for a blank app, packaged with the WAP project included.
First, using XAML, it is difficult to find the properties, methods, and events of controls without extensive use of learn.microsoft.com docs. However, each control sometimes uses similar terminology with differing meaning and impact. Hypothetically, the 'Color' property in one control may be the foreground color, while being used as the background color in a different control.
The docs also seem to better explain the properties, methods, and events from a C# perspective, while early remarks and examples use XAML. Perhaps a difference between handcrafted and auto-generated code documentation?
Searching for XAML help online is difficult. Years of changes and multiple frameworks using the same jargon (but different) make it hard to differentiate XAML information specific to WinUI 3. Even namespaces are confusingly similar.
Modifying XAML with a running application and hot reload did not modify the visual presentation on the desktop. It was necessary to close the application and rerun to see the changes. It would be helpful if there was a way to refresh the XAML code without shutting down the app and redeploying/restarting. That might make XAML useful.
As a new WinUI 3 developer, it is difficult for me to understand the "Why XAML" now with WinUI 3. I do understand that other presentation frameworks used XAML. but current documentation continues to encourage XAML as the best practice.
That said, given no visible benefit of XAML and with the VS 2022 C# IntelliCode help, I am struggling against my instincts to keep using XAML. Instead, I would like to use all C# code for all view work and ignore XAML entirely if possible.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions