Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2016-09-07 21:09:02
Size: 1157
Editor: scot
Comment:
Revision 3 as of 2016-09-07 21:34:50
Size: 2092
Editor: scot
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
Page 113-114
Line 15: Line 17:
 1. Shows that text wraps inside a label be default.
 1. Shows the use of Device.OnPlatform for padding.
 1. Handling Button Click Events
 1. Getting reference to Button firing event.
Line 20: Line 22:
 1. Label is demonstrated.  1. Button is demonstrated.
 1. object sender is the button firing the event
 1. EventArgs class contains generic event args that in this case contain nothing.
Line 25: Line 30:
Page 117-118
Line 27: Line 34:
 1. Shows that text wraps inside a label be default.
 1. Shows the use of Device.OnPlatform for padding.
 1. Using the sender to identify what button is invoking the event handler
 1. Shows how to enable and disable a button.
Line 32: Line 39:
 1. Label is demonstrated.  1. Button is demonstrated again. 
Line 37: Line 44:
Page 120
Line 39: Line 48:
 1. Shows that text wraps inside a label be default.
 1. Shows the use of Device.OnPlatform for padding.
 1. Anonymous event handlers a.k.a Lambda expresions.
 1. When using Device.GetNamedSize(NamedSize.Large, '''typeof(Label|Button)''') as appropriate.
Line 44: Line 53:
 1. Label is demonstrated.  1. Button is demonstrated again.
Line 49: Line 58:
Page 122-123
Line 51: Line 62:
 1. Shows that text wraps inside a label be default.
 1. Shows the use of Device.OnPlatform for padding.
 1. Distinguishing views with {{{StyleId}}} property in a hander that is invoked by multiple buttons.
 1. Includes concept of enabling and disabling button as appropriate.
Line 56: Line 67:
 1. Label is demonstrated.  1. Label is demonstrated again.
Line 61: Line 72:
Page 128-129
Line 63: Line 76:
 1. Shows that text wraps inside a label be default.
 1. Shows the use of Device.OnPlatform for padding.
 1. Persisting data from one run of the program to another.
 1. Lifecycle methods of Application:
    1. OnStart - executes when programs starts - initialization here
    1. OnSleep - executes when program loses focus (I.e. is no longer in command of the screen) - cleanup and saving state here
    1. OnResume - executes when a program starts up again. - cleanup and re-establishing state here.
 1. Debugging: '''OnSleep''' is activated using the respective methods to invoke the application switcher (iOS: double tap home, android: switcher button or hold home key, windows: hold back key) and '''OnResume''' by selecting the application.
Line 68: Line 86:
 1. Label is demonstrated.  1. Properties[] demonstrated in App.cs
1. Label is demonstrated again.

Chapter 6 Notes

Title: Buttons Clicks

Summary

So much ado about Buttons and the way to handle clicks. And as a bonus, we'll throw in persistence in values.

Programs

ButtonLogger

Page 113-114

Concepts:

  1. Handling Button Click Events
  2. Getting reference to Button firing event.

Classes:

  1. Button is demonstrated.
  2. object sender is the button firing the event
  3. EventArgs class contains generic event args that in this case contain nothing.

TwoButtons

Page 117-118

Concepts:

  1. Using the sender to identify what button is invoking the event handler
  2. Shows how to enable and disable a button.

Classes:

  1. Button is demonstrated again.

ButtonLambdas

Page 120

Concepts:

  1. Anonymous event handlers a.k.a Lambda expresions.
  2. When using Device.GetNamedSize(NamedSize.Large, typeof(Label|Button)) as appropriate.

Classes:

  1. Button is demonstrated again.

SimpleKeypad

Page 122-123

Concepts:

  1. Distinguishing views with StyleId property in a hander that is invoked by multiple buttons.

  2. Includes concept of enabling and disabling button as appropriate.

Classes:

  1. Label is demonstrated again.

PersistentKeypad

Page 128-129

Concepts:

  1. Persisting data from one run of the program to another.
  2. Lifecycle methods of Application:
    1. OnStart - executes when programs starts - initialization here

    2. OnSleep - executes when program loses focus (I.e. is no longer in command of the screen) - cleanup and saving state here

    3. OnResume - executes when a program starts up again. - cleanup and re-establishing state here.

  3. Debugging: OnSleep is activated using the respective methods to invoke the application switcher (iOS: double tap home, android: switcher button or hold home key, windows: hold back key) and OnResume by selecting the application.

Classes:

  1. Properties[] demonstrated in App.cs
  2. Label is demonstrated again.

ManagingAndProgrammingMobileApplications/Xamarin/Chapter 6 (last edited 2016-09-07 21:34:50 by scot)