December 2014
Intermediate to advanced
512 pages
17h 4m
English
With the x:FactoryMethod keyword in XAML2009, you can get an instance of a class that doesn’t have any public constructors. x:FactoryMethod enables you to specify any public static method that returns an instance of the desired type. For example, the following XAML uses a Guid instance returned by the static Guid.NewGuid method:
<Label xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" Background="Orange" FontSize="20"> <sys:Guid x:FactoryMethod="sys:Guid.NewGuid"/> </Label>
When x:FactoryMethod is used with x:Arguments, the arguments are ...
Read now
Unlock full access