Is there a good overview of the differences between the various dialects of XAML

When developing a universal Windows application (uwp), I often need to look for how to do different things in XAML.

One of the problems is that all too often I get a solution for WPF or Silverlight or Windows Phone that is not applicable to the UWP application. Is there a good overview of the differences between different dialects?

If not, it could be something that is part of the upcoming stackoverflow documentation documentation. I really want to participate in things that I already know about.

+8
wpf silverlight xaml win-universal-app uwp-xaml
source share
2 answers

Compiled data bindings: markup extension {x:Bind}

Databases are required to work with XAML. The XAML dialog for UWP applications provides a binding type: markup extension {x: Bind}.

Working with {Binding XXX} and {x: Bind XXX} is basically equivalent, with the difference that the x: Bind extension works at compile time, which provides better debugging capabilities (for example, break points) and better performance.

 <object property="{x:Bind bindingPath}" /> 

The x: Bind markup extension is only available for UWP applications. Read more about this in this MSDN article: https://msdn.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth .

Alternatives for Silverlight, WPF, Windows RT: use the standard {Binding XXX} syntax:

 <object property="{Binding bindingPath}" /> 

Import namespaces in XAML

In most cases, you need to import namespaces into your XAML file. How this is done is different for different versions of XAML.

For Windows Phone, Silverlight WPF uses the clr namespace syntax:

 <Window ... xmlns:internal="clr-namespace:rootnamespace.namespace" xmlns:external="clr-namespace:rootnamespace.namespace;assembly=externalAssembly" > 

Windows RT, UWP uses the syntax to use:

 <Page ... xmlns:internal="using:rootnamespace.namespace" xmlns:external="using:rootnamespace.namespace;assembly=externalAssembly" > 

Multi binding

Multi Binding is an exclusive feature for developing WPF. It allows you to bind multiple values ​​at once (usually used with MultiValueConverter).

 <TextBox> <TextBox.Text> <MultiBinding Converter="{StaticResource MyConverter}"> <Binding Path="PropertyOne"/> <Binding Path="PropertyTwo"/> </MultiBinding> </TextBox.Text> </TextBox> 

Non-WPF platforms do not support multiple bindings. You should find alternative solutions (for example, moving code from a view and converters to view mode) or using third-party actions, as in this article: http://www.damirscorner.com/blog/posts/20160221-MultibindingInUniversalWindowsApps.html )

+1
source share

Hi, once, when I started writing for UWP, I found an article that really helped me. Take a look here . Also there was already a question about this in StackOverflow here

0
source share

All Articles