Quantcast
Viewing latest article 13
Browse Latest Browse All 440

Answer by Liyun Zhang - MSFT for MAUI compiled binding - whether to use x:Type or not

First of all, please check the official document about x:Type Markup Extension. The doc said:

The x:Type markup extension can be used in object element syntax. In this case, specifying the value of the TypeName property is required to properly initialize the extension.

The x:Type markup extension can also be used as a verbose attribute; however this use is not typical: <object property="{x:Type TypeName=typeNameValue}" .../>

So the XAML Object Element Usage:<x:Type TypeName="prefix:typeNameValue"/> is always used. The x:DataType is complex property values that involve nested objects.

And the official document about Compiled bindings in .NET MAUI also only uses x:DataType="model:myclass". So using x:DataType="model:myclass" is better.


Viewing latest article 13
Browse Latest Browse All 440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>