Exemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.source = new GroupedListSource();
            this.source.TableView = this.TableView;

            // Register the TableView's data source
            this.TableView.Source = this.source;

            var groups = new List<IGroup>();

            var section1 = new GroupViewModel();
            section1.Header = new CaptionViewModel("Samples");
            groups.Add(section1);

            section1.Rows.Add(new StringElementViewModel("Simple Binding") { TapCommand = new DelegateCommand(() => {
                this.NavigationController.PushViewController(new SimpleBindingViewController(), true);
            }) });

            section1.Rows.Add(new StringElementViewModel("Simple List") { TapCommand = new DelegateCommand(() => {
                this.NavigationController.PushViewController(new SimpleListController(), true);
            }) });

            section1.Rows.Add(new StringElementViewModel("Wrapped View Model Binding To List") { TapCommand = new DelegateCommand(() => {
                this.NavigationController.PushViewController(new SimpleViewModelController(), true);
            }) });

            section1.Rows.Add(new StringElementViewModel("Widget Samples") { TapCommand = new DelegateCommand(() => {
                this.NavigationController.PushViewController(new WidgetSampleController(), true);
            }) });


            this.source.Bind(groups);
        }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.source = new GroupedListSource();
            this.source.TableView = this.TableView;

            // Register the TableView's data source
            this.TableView.Source = this.source;

            var groups = new List<IGroup>();

            var section1 = new GroupViewModel();
            section1.Header = new CaptionViewModel("Samples");
            groups.Add(section1);

            section1.Rows.Add(new StringElementViewModel("Toast") { TapCommand = new DelegateCommand(() => {
                var md = new AlertMessageDisplay();
                md.DisplayToast("toasted\nHello", true);
            }) });

            section1.Rows.Add(new StringElementViewModel("Message") { TapCommand = new DelegateCommand(() => {
                var md = new AlertMessageDisplay();
                md.DisplayMessage("title", "message", Actions.Null);
            }) });

            this.source.Bind(groups);
        }
Exemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.source = new GroupedListSource(DialogDataTemplates.DefaultTemplates());
            this.source.TableView = this.TableView;

            
            // Register the TableView's data source
            this.TableView.Source = this.source;

            this.source.Bind(SimpleListViewModel.GetViewModel());
        }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var theViewModel = new SimpleViewModel();

            theViewModel.Property1 = "Hello";
            theViewModel.Property2 = "World";


            // view did load equivalent
            this.source = new GroupedListSource(this, DialogDataTemplates.DefaultTemplates(this));
            this.source.ListView = this.ListView;

            // Register the TableView's data source
            this.ListView.Adapter = this.source;

            this.source.Bind(WrappedSimpleViewModel.GetViewModel(theViewModel));

            // Create your application here
        }
Exemplo n.º 5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.source = new GroupedListSource(DialogDataTemplates.DefaultTemplates());
            this.source.TableView = this.TableView;

            var theViewModel = new SimpleViewModel();

            theViewModel.Property1 = "Hello";
            theViewModel.Property2 = "World";


            // Register the TableView's data source
            this.TableView.Source = this.source;

            this.source.Bind(WrappedSimpleViewModel.GetViewModel(theViewModel));
        }
Exemplo n.º 6
0
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
        {
            this.source = new GroupedListSource(this.Activity, DialogDataTemplates.DefaultTemplates(this.Activity));

            // we can either put this here or in will appear, depending on what we need to do with loading for the VM.
            this.loader = new ViewModelLoader<string>(this.GetHelloWorld, this.UpdateViewModel, new UIThreadScheduler());

            return base.OnCreateView(inflater, container, savedInstanceState);
        }