protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // setup the application Setup.Instance.EnsureInitialized(ApplicationContext); _bindingContext = new MvxAndroidBindingContext(this, new LayoutInflaterProvider(LayoutInflater), new FooBarViewModel()); var view = _bindingContext.BindingInflate(Resource.Layout.Main, null); SetContentView(view); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); LightSetup.Instance.EnsureInitialized(ApplicationContext); _bindingContext = new MvxAndroidBindingContext(this, this, new PersonViewModel(this)); // Set our view from the "main" layout resource var view = _bindingContext.BindingInflate(Resource.Layout.Main, null); SetContentView(view); }
public override Dialog OnCreateDialog (Bundle savedInstanceState) { var viewModel = ViewModel as EnterResultsViewModel; BindingContext = new MvxAndroidBindingContext (Activity, new MvxSimpleLayoutInflater (Activity.LayoutInflater)); DataContext = viewModel; var builder = new AlertDialog.Builder (Activity); var view = this.BindingInflate (Resource.Layout.EnterResultsView, null); builder.SetView (view); builder.SetCancelable (true); builder.SetPositiveButton (StringResources.Save, new EventHandler<DialogClickEventArgs> ((s, e) => viewModel.SubmitResults ())) .SetNegativeButton (StringResources.Cancel, (EventHandler<DialogClickEventArgs>)null); return builder.Create (); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // setup the application Setup.Instance.EnsureInitialized(ApplicationContext); Mvx.Resolve<ITopActivity>().Activity = this; // ensure location plugin is available Cirrious.MvvmCross.Plugins.Location.PluginLoader.Instance.EnsureLoaded(); // create the view model var viewModel = Mvx.IocConstruct<LocationViewModel>(); // create the databound UI _bindingContext = new MvxAndroidBindingContext(this, new LayoutInflaterProvider(LayoutInflater), viewModel); var view = _bindingContext.BindingInflate(Resource.Layout.Main, null); SetContentView(view); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Initialize binding setup BindingSetup.Instance.Initlialize(ApplicationContext); // Create service agent and view model ICustomerServiceAgent serviceAgent = new MockCustomerServiceAgent(); var customerViewModel = new CustomerViewModel(serviceAgent); // Create binding context, passing view model _bindingContext = new MvxAndroidBindingContext(this, this, customerViewModel); // Create view by inflating binding on binding context var view = _bindingContext.BindingInflate(Resource.Layout.Main, null); // Set content view passing inflated view with bindings SetContentView(view); }
protected MvxFragmentCompatActivity(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) { BindingContext = new MvxAndroidBindingContext(this, this); this.AddEventListeners(); }
protected MvxFragmentCompatActivity() { BindingContext = new MvxAndroidBindingContext(this, this); this.AddEventListeners(); }
protected MvxKillableActivity() { BindingContext = new MvxAndroidBindingContext(this, this); this.AddEventListeners(); }
public MvxActionBarActivity() { BindingContext = new MvxAndroidBindingContext(this, this); this.AddEventListeners(); }
private void Initialize() { EmptyControlBehaviour = this.GetDefaultEmptyControlBehaviour(); BindingContext = new MvxAndroidBindingContext(Context, this); if (!Mvx.CanResolve<IMvxControlsContainer>()) new Plugin().Load(); _container = Mvx.Resolve<IMvxControlsContainer>(); _container.Add(this); }
public CustomViewElement(Context context) { BindingContext = new MvxAndroidBindingContext(context, (IMvxLayoutInflater)context); }
protected MvxLinearDialogActivity() { BindingContext = new MvxAndroidBindingContext(this, this); this.AddEventListeners(); }
public override Android.Support.V7.Widget.RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { var itemBindingContext = new MvxAndroidBindingContext(parent.Context, _bindingContext.LayoutInflaterHolder); return new MvxRecyclerViewHolder(InflateViewForHolder(parent, viewType, itemBindingContext), itemBindingContext) { Click = ItemClick, LongClick = ItemLongClick }; }