.netwpfxaml

What's the point of XamlType.GetAliasedProperty


I've tried looking for information about this method and I'm unable to understand what's the meaning and utility of it.

This is what MSDN says about it: https://msdn.microsoft.com/en-us//library/vstudio/system.xaml.xamltype.getaliasedproperty(v=vs.100).aspx

What does it do, in other words? Are examples available?


Solution

  • You could imagine, buttonXamlType.GetAliasedProperty(XamlLanguage.Name) would return a XamlMember for FrameworkElement.Name. This means that x:Name and Name, when used on a button, are aliased, or synonymous. Defined by [RuntimeNamePropertyAttribute("Name")] decoration on FrameworkElement class.

    Asking buttonXamlType.GetAliasedProperty(XamlLanguage.Lang) would return a XamlMember for FrameworkElement.Language, as the [XmlLangProperty("Language")] attribute is on the FrameworkElement class.

    -Rob Relyea, PM/Architect for System.Xaml.dll