1591
Comment:
|
1603
|
Deletions are marked like this. | Additions are marked like this. |
Line 31: | Line 31: |
'''Property-Element Syntax''': | '''Property-[Element|Attribute] Syntax''': |
Chapter 7 Notes
Title: XAML vs. Code
Summary
- XAML is a better way to write up the "view" part of MVVM.
- XAML is used to write the tree-structured visual user interface
Concepts Not in programs
Converter Classes
Page 134
Below the Color class has a TypeConverter attribute added. Attributes in this context means that the defined attributed class is added to the decorated class. That means that you may have additional properties because of the decoration. You might say that Color now has a TypeConverter object that is instantiated with a Type - in this case the: typeof(ColorTypeConverter)
This, of course, means that Color has additional functionality! We'll learn more about this later!
Property-[Element|Attribute] Syntax:
Page 136
This section spells out how to translate some of the code we are used to writing into XAML. Specifically it identifies how XML elements and attributes map to objects and contents.
E.g.:
<Frame ...> ... </Frame> is a object element
<Frame.Content> ... </Frame.Content> is a property element
In <Frame VerticalOptions="Center" ...> ... </Frame>, VerticalOptions is a property attribute.
Programs
Program Baskervilles
Page 41.
Concepts:
- Shows that text wraps inside a label be default.
Shows the use of Device.OnPlatform for padding.
Classes:
- Label is demonstrated.