Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "Customers";

            var tableSource = new CustomerListTableViewSource(TableView);

            tableSource.SelectionChanged += (sender, args) => ViewModel.CustomerSelectedCommand.Execute(args.AddedItems[0]);

            this.AddBindings(new Dictionary <object, string>()
            {
                { tableSource, "{'ItemsSource':{'Path':'Customers'}}" }
            });

            TableView.Source = tableSource;
            TableView.ReloadData();

#warning iPad behaviour commented out
            //if (MXTouchNavigation.MasterDetailLayout && Model.Count > 0)
            //{
            // we have two available panes, fill both (like the email application)
            //this.Navigate(string.Format("Customers/{0}", Model[0].ID));
            //}

            NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, e) => ViewModel.AddCommand.Execute()), false);
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "Customers";

            var tableSource = new CustomerListTableViewSource(TableView);

            this.AddBindings(new Dictionary <object, string>()
            {
                { tableSource, "ItemsSource Customers; SelectionChangedCommand CustomerSelectedCommand" }
            });

            TableView.Source = tableSource;
            TableView.ReloadData();

            // note that .AddCommand.Execute(null) is not used here - problem with ICommand and signed assemblies in Windows/VS
            NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, e) => ViewModel.DoAdd()), false);
        }
        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();
            
            Title = "Customers";

            var tableSource = new CustomerListTableViewSource(TableView);
            
            this.AddBindings(new Dictionary<object, string>()
                                 {
                                     {tableSource, "ItemsSource Customers; SelectionChangedCommand CustomerSelectedCommand"}
                                 });

            TableView.Source = tableSource;
            TableView.ReloadData();

            // note that .AddCommand.Execute(null) is not used here - problem with ICommand and signed assemblies in Windows/VS
            NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, e) => ViewModel.DoAdd()), false);
        }