Benefits of UI Design in XAML

In WPF I can make my UI using .NET 2.0 style like designer.cs, my question is what are the benefits of using XAML for UI design instead of code.

+2


source to share


3 answers


The main advantage is that if you keep a clean separation of markup and code (for example, using the MVVM pattern ), you can concentrate on the behavior of the application (i.e., the code) and let professional graphic designers worry about applying the look and feel of the application.



These two tasks can be run in parallel by two different people using different tools (for example, Visual Studio vs. Expression).

+6


source


The main advantage is that you can separate the look and feel of your application from your code.

By interacting with your code using command bindings and events, it allows you to completely isolate business logic from the GUI.



This allows graphic / web designers to focus on the front-end and the business logic coders. You will also find that things like animation can be fully front-end handled in XAML, without any source code.

This means that you can change all the visual aspects of the application without changing the business logic.

+1


source


There are several reasons I can say ...

  • Supported by Expression Blend and Expression Design. They are more powerful and easier to use than the Visual Studio Design Panel.
  • It's easier to change Xaml manually for some simple things like say

    <Rectangle Margin = 20,20,10,0 "VerticalAlignment =" Center "Fill =" Red "/">

  • Xaml is easier for a designer to understand than C # code.

  • You can easily separate design (XAML) and code. It's not that obvious when using designer.cs
+1


source







All Articles