Join James Timberlake for an in-depth discussion in this video Add behaviors to a style, part of Extending Xamarin with Behaviors, Commands, and Triggers.
- [Instructor] At last we have our BaseAttachedBehavior.…Now let's add a functionality for managing…attaching and detaching formed behavior…based on the behavior type.…We want to do this functionality…inside of the OnAttachBehaviorChanged event.…First thing we want to do is make sure…that this bindable view is set to a view,…if not, it will not have a behavior attached to it.…Next, we'll check to see if this view has any behaviors…added to it already.…
If not, we'll add one, if the newValue is set to true.…Remember, new values and objects,…we'll need to cast it with bool.…What I like to do here, if we have a list here,…we want to use the FirstOrDefault method.…That uses a System.Linq, so we're going to add it here now.…
We're going to check the behavior…where the behavior is the behavior type.…Remember, we can have multiple behaviors of different types…and we want to make sure that we get the right one…to check whether or not it's available.…If the behavior is null,…we're going to go ahead and add that behavior.…
- Creating and implementing behaviors
- Stacking behaviors
- Adding behaviors to styles
- Creating commands
- Setting up and implementing triggers
- Tying it all together in a Xamarin app
Skill Level Intermediate
F# and Xamarin Development Basicswith Rachel Reese56m 43s Intermediate
1. Using Xamarin Behaviors
2. Using Xamarin Commands
3. Using Xamarin Triggers
4. Tying It All Together
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.