Differences between revisions 1 and 2
Revision 1 as of 2016-10-03 13:43:37
Size: 1203
Editor: scot
Comment:
Revision 2 as of 2016-10-03 14:46:38
Size: 3259
Editor: scot
Comment:
Deletions are marked like this. Additions are marked like this.
Line 71: Line 71:

=== Program ImplicitStyle ===

Page 265.

Concepts:

 1. Shows implicit styles - that is styles that are applied to an object even when it doesn't specify a style. How, a {{{TargetType}}} without a {{{x:Key}}}.

Classes:

No new classes.

=== Program StyleHierarchy ===

Page 268.

Concepts:

 1. Shows hierarchical styles from the app.xaml file.

Classes:

No new classes.

=== Program DynamicStyles ===

Page 271.

Concepts:

 1. Shows Dynamic vs. the {{{StaticResource}}} styles we have used so far
 1. Shows buttons that can be dynamically change their styles - cool demo.

Classes:

No new classes.

=== Program DynamicStylesInheritance ===

Page 275.

Concepts:

 1. similar to the previous program this one adds {{{BaseResourceKey}}} to reference the {{{buttonStyle}}} entry and add a couple of properties including {{{OnPlatform}}}.

Classes:

No new classes.

=== Program DeviceSytlesList ===

Page 278.

Concepts:

Xamarin.Forms includes six built-in styles known as device styles that are members of a nested class of {{{Device}}}} named {{{Styles}}}. This {{{Style}}} class defines 12 static readonly fields that help reference these six styles '''in code'''.

 * {{{BodyStyle}}} of type Style.
 * {{{BodyStyleKey}}} of type string and equal to {{{BodyStyle}}}.”
 * {{{TitleStyle}}} of type Style.
 * {{{TitleStyleKey}}} of type string and equal to {{{TitleStyle}}}.”
 * {{{SubtitleStyle}}} of type Style.
 * {{{SubtitleStyleKey}}} of type string and equal to {{{SubtitleStyle.”
 * {{{CaptionStyle}}} of type Style.
 * {{{CaptionStyleKey}}} of type string and equal to {{{CaptionStyle}}}.”
 * {{{ListItemTextStyle}}} of type Style.
 * {{{ListItemTextStyleKey}}} of type string and equal to {{{ListItemTextStyle}}}.”
 * {{{ListItemDetailTextStyle}}} of type Style.
 * {{{ListItemDetailTextStyleKey}}} of type string and equal to {{{ListItemDetailTextStyle}}}.

Classes:

 * Device.Styles is a list of the above styles that are unique to the device.

Chapter 12 Notes

Title: Styles

Summary

Setting styles on your Views.

Programming Concepts Summary

Concept

Page

Style defined in a resource dictionary an element like ContentPage

254

Style inheritance

261

Programs

Program BasicStyle

Page 255.

Concepts:

  1. Shows how to setup a style and used it with a Button

Classes:

No new classes.

Program BasicStyleCode

Page 259.

Concepts:

  1. Shows how to setup a style in a ResourceDictionary and used it with a Button in code.

Classes:

No new classes.

Program Modified BasicStyle

Page 259.

Concepts:

  1. Shows how to setup a style in a ResourceDictionary and used it with multiple view types by setting its TargetType = "View".

Classes:

No new classes.

Program StyleInheritance

Page 263.

Concepts:

  1. Shows how inheritance works with nested containers like StackLayout.

  2. Shows how to inheritance within a group by using the basedon attribute to inherit from another style.

Classes:

No new classes.

Program ImplicitStyle

Page 265.

Concepts:

  1. Shows implicit styles - that is styles that are applied to an object even when it doesn't specify a style. How, a TargetType without a x:Key.

Classes:

No new classes.

Program StyleHierarchy

Page 268.

Concepts:

  1. Shows hierarchical styles from the app.xaml file.

Classes:

No new classes.

Program DynamicStyles

Page 271.

Concepts:

  1. Shows Dynamic vs. the StaticResource styles we have used so far

  2. Shows buttons that can be dynamically change their styles - cool demo.

Classes:

No new classes.

Program DynamicStylesInheritance

Page 275.

Concepts:

  1. similar to the previous program this one adds BaseResourceKey to reference the buttonStyle entry and add a couple of properties including OnPlatform.

Classes:

No new classes.

Program DeviceSytlesList

Page 278.

Concepts:

Xamarin.Forms includes six built-in styles known as device styles that are members of a nested class of Device} named Styles. This Style class defines 12 static readonly fields that help reference these six styles in code.

  • BodyStyle of type Style.

  • BodyStyleKey of type string and equal to BodyStyle.”

  • TitleStyle of type Style.

  • TitleStyleKey of type string and equal to TitleStyle.”

  • SubtitleStyle of type Style.

  • SubtitleStyleKey of type string and equal to {{{SubtitleStyle.”

  • CaptionStyle of type Style.

  • CaptionStyleKey of type string and equal to CaptionStyle.”

  • ListItemTextStyle of type Style.

  • ListItemTextStyleKey of type string and equal to ListItemTextStyle.”

  • ListItemDetailTextStyle of type Style.

  • ListItemDetailTextStyleKey of type string and equal to ListItemDetailTextStyle.

Classes:

  • Device.Styles is a list of the above styles that are unique to the device.

ManagingAndProgrammingMobileApplications/Xamarin/Chapter 12 (last edited 2016-10-03 14:46:38 by scot)