BindingInflate() public method

public BindingInflate ( int resourceId, Android.Views.ViewGroup viewGroup ) : Android.Views.View
resourceId int
viewGroup Android.Views.ViewGroup
return Android.Views.View
Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }