Last active
December 22, 2015 21:19
-
-
Save rid00z/6532949 to your computer and use it in GitHub Desktop.
ios Bindable View. Required because of limitations with ViewController, specifically ViewControllers always require a NavigationController which we don't want on all views.
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
public class MvxBindableView : MvxView, IMvxTouchView, IMvxEventSourceViewController | |
{ | |
public event EventHandler ViewDidLoadCalled; | |
public event EventHandler<MvxValueEventArgs<bool>> ViewWillAppearCalled; | |
public event EventHandler<MvxValueEventArgs<bool>> ViewDidAppearCalled; | |
public event EventHandler<MvxValueEventArgs<bool>> ViewDidDisappearCalled; | |
public event EventHandler<MvxValueEventArgs<bool>> ViewWillDisappearCalled; | |
public event EventHandler DisposeCalled; | |
#region IMvxTouchView implementation | |
MvxViewModelRequest _request; | |
MvxViewModelRequest IMvxTouchView.Request | |
{ | |
get | |
{ | |
return _request; | |
} | |
set | |
{ | |
_request = value; | |
} | |
} | |
#endregion | |
#region IMvxView implementation | |
protected IMvxViewModel _viewModel; | |
IMvxViewModel Cirrious.MvvmCross.Views.IMvxView.ViewModel { | |
get { return _viewModel; } | |
set | |
{ | |
_viewModel = value; | |
DataContext = _viewModel; | |
} | |
} | |
#endregion | |
public MvxBindableView () | |
{ | |
BindingContext = new MvxBindingContext(); | |
} | |
public virtual void Load() | |
{ | |
MvxViewControllerExtensionMethods.OnViewCreate (this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment