Last active
August 29, 2015 14:28
-
-
Save Adam--/963889b1dcc5b84089d5 to your computer and use it in GitHub Desktop.
MvvmCross binding examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Show the view model. | |
/// </summary> | |
[MvxCommand("ShowCommand")] | |
public void Show() | |
{ | |
this.ShowViewModel<MainViewModel>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local:MvxBind="Click ShowCommand" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Show the view model. | |
/// </summary> | |
public void ShowCommand() | |
{ | |
this.ShowViewModel<MainViewModel>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Backing field for my command. | |
/// </summary> | |
private MvxCommand showCommand; | |
/// <summary> | |
/// Gets My Command. | |
/// <para> | |
/// An example of a command and how to navigate to another view model | |
/// Note the ViewModel inside of ShowViewModel needs to change! | |
/// </para> | |
/// </summary> | |
public ICommand ShowCommand | |
{ | |
get | |
{ | |
return this.showCommand ?? (this.showCommand = new MvxCommand(this.Show)); | |
} | |
} | |
/// <summary> | |
/// Show the view model. | |
/// </summary> | |
public void Show() | |
{ | |
this.ShowViewModel<MainViewModel>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment