1 / 20

XAML

XAML. XAML - definition. Extensible Application Markup Language Declarative language XAML is used to construct and initializing .NET objects XAML is only interesting together with an API ( Silverlight /WPF) Everything we can do in XAML, we can also do in .NET code. XAML Namespaces.

frayne
Download Presentation

XAML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XAML

  2. XAML - definition Extensible Application Markup Language Declarative language XAML is used to construct and initializing .NET objects XAML is only interesting together with an API (Silverlight/WPF) Everything we can do in XAML, we can also do in .NET code

  3. XAML Namespaces Default namespacexmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Secondary namespacexmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Reference namespaces in same assemblyxmlns:local="clr-namespace:MyProject" Reference namespace in external assemblyxmlns:myLib="clr-namespace:MyNamespace;assembly=MyLibrary"

  4. Object Element Syntax

  5. Child Objects Declaring objects inside another object

  6. ChildObjects The Content Property

  7. Attribute Syntax The default way to set a property in XAML

  8. Content Element Syntax Some object allow content to be set directly without specifying the property name

  9. Property Element Syntax The Property element syntax is used when we need to nest more complex definitions inside a property

  10. Collection Syntax The collection syntax adds object to a collection

  11. Type Converters

  12. MarkupExtensions A Markup Extension is a class that decides at runtime how to set a property’s value Build-in Markup Extensions in Silverlight- Binding- StaticResource- TemplateBinding- NullExtension

  13. The Binding Extension The Binding Extension is used for data binding

  14. The StaticResourceExtension The StaticResourceExtention returns the value of the specified resource. This is a one-time resource lookup

  15. The TemplateBindingExtension Links the value of a property in a control template to the value of some other exposed property on the templated control.

  16. NullExtension Setting a value to null in XAML

  17. Escaping the curly braces

  18. Code behind XAML supports code behind through partial classes When the x:class attribute is defined, the XAML compiler will generate a partial class from the markup

  19. Events in XAML Two ways to attach event handlers- attach in XAML or- attach in the Code Behind

  20. WPF Compatibility MarkupExtensions differences- x:TypeExtensiion- x:ArrayExtension- x:Static- DynamicResourceExtension- RelativeSourceExtension CustomMarkupExtensions

More Related