protected override void InitializeBindings() { base.InitializeBindings(); // choice here: // // for original demo use: // var source = new MvxStandardTableViewSource(tableView, "TitleText"); // // or for prettier cells from XIB file use: // tableView.RowHeight = 88; // var source = new MvxSimpleTableViewSource(tableView, BookCell.Key, BookCell.Key); tableView.RowHeight = 44; var source = new MvxSimpleTableViewSource(tableView, PayHistoryCell.Key, PayHistoryCell.Key); tableView.Source = source; var set = this.CreateBindingSet <PayHistoryView, PayHistoryViewModel>(); set.Bind(backHomeView).To(vm => vm.BackHomeCommand); set.Bind(dowloadHistoryButton).To(vm => vm.DownloadHistoryCommand); set.Bind(source).To(vm => vm.History); set.Apply(); }
public OrderCell(IntPtr handle) : base(string.Empty /* TODO - this isn't really needed - mvx bug */, handle) { this.DelayBind(() => { productTableView = new UITableView(new CGRect(0 , 0 , TestView.Bounds.Width , TestView.Bounds.Height)); TestView.AddSubview(productTableView); TestView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight; productTableView.RegisterClassForCellReuse(typeof(ProductCell), ProductCell.Key); var source = new MvxSimpleTableViewSource(productTableView, ProductCell.Key, ProductCell.Key); productTableView.Source = source; var set = this.CreateBindingSet <OrderCell, PayedOrder>(); set.Bind(RowLabel).To(order => order.Order.RowNumber); set.Bind(Timerlbl).To(order => order.CloseOrderTimer.WaitTime) .WithConversion("StringFormat", "mm\\:ss"); set.Bind(source).To(order => order.Order.OrderedFood); set.Bind(OverOrderBtn).To("OnFinishOrder"); set.Bind(OverOrderBtn).For("Visibility").To(order => order.IsOrderFinished) .WithConversion("Visibility"); set.Apply(); //ProductTabel.ReloadData(); productTableView.ReloadData(); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); var folderControl = new FolderControl(); AddChildViewController(folderControl); FolderView.AddSubview(folderControl.View); var mailControl = new MailControl(); AddChildViewController(mailControl); MailView.AddSubview(mailControl.View); var source = new MvxSimpleTableViewSource(FoldersTable, FolderCellTemplate.Key, FolderCellTemplate.Key); FoldersTable.Source = source; var set = this.CreateBindingSet <FoldersView, FoldersViewModel>(); set.Bind(source).To(vm => vm.Folders); set.Bind(source).For(s => s.SelectedItem).To(vm => vm.SelectedFolder); set.Apply(); this.Title = "MailApp"; //As the folder is also showed on this view, we don't wait for the user to select one ((FoldersViewModel)ViewModel).SelectedFolder = ((FoldersViewModel)ViewModel).Folders.FirstOrDefault(); }
private void SetupTableSource() { _storiesSource = new SimpleTableViewSource(StoriesTable, typeof(StoryCell), StoryCell.Key, StoriesHeightConstraint); StoriesTable.Source = _storiesSource; StoriesTable.RowHeight = 50; StoriesTable.TranslatesAutoresizingMaskIntoConstraints = false; }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(News, NewsCell.Key); var set = this.CreateBindingSet <NewsView, NewsViewModel>(); set.Bind(source).To("Articles"); set.Bind(source).For(v => v.SelectionChangedCommand).To("OpenNewsDetails"); set.Apply(); News.Source = source; News.TableFooterView = new UIView(new CoreGraphics.CGRect(0, 0, 0, 9f)); UILocalNotification notification = new UILocalNotification(); notification.FireDate = NSDate.FromTimeIntervalSinceNow(15); //notification.AlertTitle = "Alert Title"; // required for Apple Watch notifications notification.AlertAction = "View Alert"; notification.AlertTitle = "Happy birthday" + MyAnimalsViewModel.GetAnimalName() + "!"; notification.AlertBody = MyAnimalsViewModel.GetAnimalName() + " just got 2 years old. Check out his activity now!"; UILocalNotification notification2 = new UILocalNotification(); notification2.FireDate = NSDate.FromTimeIntervalSinceNow(30); //notification.AlertTitle = "Alert Title"; // required for Apple Watch notifications notification2.AlertAction = "View Alert"; notification2.AlertTitle = MyAnimalsViewModel.GetAnimalName() + " flown 6 miles today."; notification2.AlertBody = "How many miles did you walk today?"; UIApplication.SharedApplication.ScheduleLocalNotification(notification); UIApplication.SharedApplication.ScheduleLocalNotification(notification2); }
public override void ViewDidLoad() { if (RespondsToSelector(new Selector("edgesForExtendedLayout"))) { EdgesForExtendedLayout = UIRectEdge.None; } base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(BowTieTableView, BowTieViewCell.Key, BowTieViewCell.Key); BowTieTableView.Source = source; var set = this.CreateBindingSet <FirstView, Core.ViewModels.FirstViewModel>(); set.Bind(source).To(ViewModel => ViewModel.BowTies); set.Bind(GetBowTiesButton).To(ViewModel => ViewModel.GetBowtiesCommand); set.Apply(); //((FirstViewModel)this.ViewModel).GetBowtiesCommand.Execute(null); BowTieTableView.ReloadData(); }
public override void ViewDidLoad() { View = new UIView { BackgroundColor = UIColor.White }; base.ViewDidLoad(); if (RespondsToSelector(new Selector("edgesForExtendedLayout"))) { EdgesForExtendedLayout = UIRectEdge.None; } TableView = new UITableView(new CGRect(10, 10, 300, 700)); var source = new MvxSimpleTableViewSource(TableView, DetailsCell.Key, DetailsCell.Key); //DetailsCell.Key, DetailsCell.Key); TableView.RowHeight = 100; TableView.Source = source; var set = this.CreateBindingSet <FirstView, FirstViewModel>(); set.Bind(source).To(vm => vm.Details); set.Apply(); TableView.ReloadData(); }
//public FirstView() : base("FirstView", null) //{ //} public override void ViewDidLoad() { this.View = new UIView { BackgroundColor = UIColor.White }; base.ViewDidLoad(); var tableView = new UITableView(new RectangleF(0, 0, 320, 640)); tableView.RowHeight = 100; var source = new MvxSimpleTableViewSource(tableView, QuestionTableViewCell.Key, QuestionTableViewCell.Key); tableView.Source = source; Add(tableView); var loadingIndicator = new UIActivityIndicatorView(new RectangleF(130, 260, 60, 60)); loadingIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge; loadingIndicator.Color = UIColor.Purple; loadingIndicator.HidesWhenStopped = true; loadingIndicator.StartAnimating(); Add(loadingIndicator); var set = this.CreateBindingSet <FirstView, FirstViewModel>(); set.Bind(source).To(vm => vm.Questions); set.Bind(Title).To(vm => vm.QuestionsTag); set.Bind(tableView).For("Visibility").To(vm => vm.IsLoading).WithConversion("InvertedVisibility"); set.Bind(loadingIndicator).For("Visibility").To(vm => vm.IsLoading).WithConversion("Visibility"); set.Apply(); tableView.ReloadData(); }
protected override void InitView() { base.InitView(); _table = new UITableView { TranslatesAutoresizingMaskIntoConstraints = false, RowHeight = UITableView.AutomaticDimension, EstimatedRowHeight = 44f, SeparatorColor = UIColor.Clear, BackgroundColor = UIColor.Clear, TableFooterView = new UIView(CGRect.Empty), TableHeaderView = new UIView(CGRect.Empty) }; _source = new MvxSimpleTableViewSource(_table, typeof(LogItemTableViewCell), LogItemTableViewCell.Key); _table.Source = _source; notAvailableView = new CameraNotAvailableView { TranslatesAutoresizingMaskIntoConstraints = false }; cameraControlsView = new CameraControlsView { TranslatesAutoresizingMaskIntoConstraints = false }; }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(SectionTable, "MenuTableViewCell", MenuTableViewCell.Key); SectionTable.RowHeight = 50; var set = this.CreateBindingSet <MenuView, MenuViewModel>(); set.Bind(source).To(vm => vm.Sections); var addItem = new UIBarButtonItem(UIBarButtonSystemItem.Add) { Title = "New" }; set.Bind(addItem).To(vm => vm.AddCommand); NavigationItem.RightBarButtonItem = addItem; set.Apply(); SectionTable.Source = source; SectionTable.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); AnswersTableView.TableFooterView = new UIView(); var source = new MvxSimpleTableViewSource(AnswersTableView, AnswerViewCell.Key, AnswerViewCell.Key, null); AnswersTableView.Source = source; var set = this.CreateBindingSet <TrafficCardQuestionView, TrafficCardQuestionViewModel>(); set.Bind(TrafficCardQuestionLabel).To(vm => vm.CurrentQuestion.QuestionText); set.Bind(source).To(vm => vm.CurrentQuestion.TrafficCardAnswers); set.Bind(source).For(s => s.SelectedItem).To(vm => vm.CurrentAnswer); set.Apply(); AnswersTableView.ReloadData(); var cancelButton = new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Plain, (sender, e) => { TrafficCardQuestionViewModel.CancelCommand.Execute(null); }); cancelButton.SetTitleTextAttributes(new UITextAttributes() { Font = UIFont.FromName("Raleway-Bold", 18), TextColor = UIColor.White }, UIControlState.Normal); var saveButton = new UIBarButtonItem("Save", UIBarButtonItemStyle.Plain, (sender, e) => { var bounds = UIScreen.MainScreen.Bounds; // show the loading overlay on the UI thread using the correct orientation sizing alertOverlay = new AlertOverlay(bounds, "Saving..."); View.Add(alertOverlay); TrafficCardQuestionViewModel.SaveCommand.Execute(null); }); saveButton.SetTitleTextAttributes(new UITextAttributes() { Font = UIFont.FromName("Raleway-Bold", 18), TextColor = UIColor.White }, UIControlState.Normal); this.NavigationItem.SetLeftBarButtonItem(cancelButton, true); this.NavigationItem.SetRightBarButtonItem(saveButton, true); this.NavigationItem.Title = "Question"; var stringAttributes = new UIStringAttributes(); stringAttributes.Font = UIFont.FromName("Raleway-Bold", 20); stringAttributes.ForegroundColor = UIColor.FromRGB(255, 255, 255); NavigationController.NavigationBar.BarTintColor = ProspectManagementColors.DarkColor; NavigationController.NavigationBar.TintColor = UIColor.White; NavigationController.NavigationBar.TitleTextAttributes = stringAttributes; selectAnswerInTableView(); }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.Title = "All Requests"; NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White }; var source = new MvxSimpleTableViewSource(VacationTable, "VacationTableViewCell", VacationTableViewCell.Key); VacationTable.RowHeight = 50; var set = this.CreateBindingSet <VacationTableView, VacationViewModel>(); set.Bind(source).To(vm => vm.Vacations); var addItem = new UIBarButtonItem(UIBarButtonSystemItem.Add) { Title = "New" }; set.Bind(addItem).To(vm => vm.AddCommand); NavigationItem.RightBarButtonItem = addItem; set.Apply(); VacationTable.Source = source; VacationTable.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); _tableSource = new MvxSimpleTableViewSource(DataTable, DataEntryCell.Key, DataEntryCell.Key); var set = this.CreateBindingSet <ContentPage, ContentPageViewModel>(); set.Bind(UsernameLbl).To(vm => vm.SignInCredentials.Username); set.Bind(PasswordLbl).To(vm => vm.SignInCredentials.Password); set.Bind(AddEntryBtn).To(vm => vm.AddEntryCommand); set.Bind(RemoveEntryBtn).To(vm => vm.RemoveEntryCommand); set.Bind(LogoutBtn).To(vm => vm.LogoutCommand); set.Bind(_tableSource).To(vm => vm.DataEntries); set.Apply(); DataTable.RowHeight = 60; DataTable.Source = _tableSource; DataTable.ReloadData(); SwitchViewSC.ValueChanged += switchViewScOnValueChanged; AddEntryBtn.TouchUpInside += addEntryBtnOnTouchUpInside; RemoveEntryBtn.TouchUpInside += removeEntryBtnOnTouchUpInside; }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. var collectionSource = new MvxCollectionViewSource(collectionView, FirstCell.Key); collectionView.RegisterNibForCell(FirstCell.Nib, FirstCell.Key); collectionView.Source = collectionSource; var tableSource = new MvxSimpleTableViewSource(tableView, TableViewCell.Key, TableViewCell.Key); tableView.RegisterNibForCellReuse(TableViewCell.Nib, TableViewCell.Key); tableView.Source = tableSource; tableView.AllowsSelection = false; //binding var set = this.CreateBindingSet <FirstView, FirstViewModel>(); set.Bind(collectionSource).To(vm => vm.AllNumbers); set.Bind(tableSource).To(vm => vm.AllGroups); set.Apply(); collectionView.ReloadData(); tableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. /*var source = new MvxStandardTableViewSource( * TableView, * UITableViewCellStyle.Subtitle, * new NSString("ExampleOverviewView"), * "TitleText Description;DetailText Value", * UITableViewCellAccessory.DisclosureIndicator); * * this.AddBindings( * new Dictionary<object, string>() * { * { source, "ItemsSource ExampleViewModel" } * }); * * TableView.Source = source; * TableView.ReloadData();*/ var source = new MvxSimpleTableViewSource( TableView, ExampleOverviewTableCell.Key, ExampleOverviewTableCell.Key); TableView.Source = source; this.CreateBinding(source) .To <ExampleOverviewViewModel>(vm => vm.ExampleViewModel) .Apply(); // Perform our MVVM Binding var set = this.CreateBindingSet <ExampleOverviewView, ExampleOverviewViewModel> (); set.Bind(source) .To(vm => vm.ExampleViewModel); set .Bind(BoiletPlateLabel1) .To(vm => vm.ExampleViewModel.Count); set .Bind(BoiletPlateTextField1) .To(vm => vm.ExampleViewModel.Count); set .Bind(BoiletPlateLabel2) .To(vm => vm.ExampleViewModel.Distance); set .Bind(BoiletPlateTextField2) .To(vm => vm.ExampleViewModel.Distance); set.Apply(); TableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.FromRGB(242, 242, 242); tblCreditCards.BackgroundView = new UIView { BackgroundColor = UIColor.Clear }; tblCreditCards.BackgroundColor = UIColor.Clear; tblCreditCards.SeparatorColor = UIColor.Clear; tblCreditCards.SeparatorStyle = UITableViewCellSeparatorStyle.None; tblCreditCards.AlwaysBounceVertical = false; tblCreditCards.DelaysContentTouches = false; var tableViewSource = new MvxSimpleTableViewSource(tblCreditCards, CreditCardCell.Key); tblCreditCards.Source = tableViewSource; tblCreditCards.RowHeight = 66; if (!ViewModel.CanChooseTip) { lblTip.RemoveFromSuperview(); txtTip.RemoveFromSuperview(); } else { ConfigureTipSection(); } FlatButtonStyle.Green.ApplyTo(btnAddCard); var set = this.CreateBindingSet <CreditCardMultipleView, CreditCardMultipleViewModel>(); set.Bind(tableViewSource) .For(v => v.ItemsSource) .To(vm => vm.CreditCards); set.Bind(tableViewSource) .For(v => v.SelectionChangedCommand) .To(vm => vm.NavigateToDetails); set.Bind(txtTip) .For(v => v.Text) .To(vm => vm.PaymentPreferences.TipAmount); set.Bind(btnAddCard) .To(vm => vm.NavigateToAddCard); set.Bind(btnAddCard) .For("HiddenEx") .To(vm => vm.CanAddCard) .WithConversion("BoolInverter"); set.Apply(); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. NavigationItem.Title = "Products"; var source = new MvxSimpleTableViewSource(TableView, ProductCell.Key, ProductCell.Key); TableView.Source = source; }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(TableView, DescriptionCell.Key, DescriptionCell.Key); this.CreateBinding(source).To<HomeViewModel>(vm => vm.Descriptions).Apply(); TableView.RowHeight = 100.0f; TableView.Source = source; TableView.ReloadData(); }
public override void ViewDidLoad() { View = new UIView() { BackgroundColor = UIColor.White }; base.ViewDidLoad(); // ios7 layout if (RespondsToSelector(new Selector("edgesForExtendedLayout"))) { EdgesForExtendedLayout = UIRectEdge.None; } var textField = new UITextField(new RectangleF(10, 10, 300, 40)); Add(textField); var activity = new UIActivityIndicatorView(new RectangleF(130, 130, 60, 60)); activity.Color = UIColor.Orange; Add(activity); var tableView = new UITableView(new RectangleF(0, 50, 320, 500), UITableViewStyle.Plain); Add(tableView); // choice here: // // for original demo use: // var source = new MvxStandardTableViewSource(tableView, "TitleText"); // // or for prettier cells from XIB file use: // tableView.RowHeight = 88; // var source = new MvxSimpleTableViewSource(tableView, BookCell.Key, BookCell.Key); tableView.RowHeight = 88; var source = new MvxSimpleTableViewSource(tableView, BookCell.Key, BookCell.Key); tableView.Source = source; var set = this.CreateBindingSet <FirstView, Core.ViewModels.FirstViewModel>(); set.Bind(textField).To(vm => vm.SearchTerm); set.Bind(textField).For(t => t.Enabled).To(vm => vm.IsLoading).WithConversion("InverseBool"); set.Bind(source).To(vm => vm.Results); set.Bind(activity).For("Visibility").To(vm => vm.IsLoading).WithConversion("Visibility"); set.Bind(tableView).For("Visibility").To(vm => vm.IsLoading).WithConversion("InvertedVisibility"); set.Apply(); tableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(TableView, DescriptionCell.Key, DescriptionCell.Key); this.CreateBinding(source).To <HomeViewModel>(vm => vm.Descriptions).Apply(); TableView.RowHeight = 100.0f; TableView.Source = source; TableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(Animals, AnimalCell.Key); var set = this.CreateBindingSet <MyAnimalsView, MyAnimalsViewModel>(); set.Bind(source).To(vm => vm.Items); set.Bind(source).For(vm => vm.SelectionChangedCommand).To("OpenAnimalDetails"); Animals.Source = source; set.Apply(); Animals.TableFooterView = new UIView(new CoreGraphics.CGRect(0, 0, 0, 9f)); }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(AccountList, AccountTableCell.Key); this.CreateBinding(source).To <AccountListViewModel>(vm => vm.IncludedAccounts).Apply(); this.CreateBinding(source).For(s => s.SelectionChangedCommand).To <AccountListViewModel>(vm => vm.OpenOverviewCommand).Apply(); AccountList.RowHeight = 55; AccountList.Source = source; AccountList.ReloadData(); }
private void SetupTicketsTabView() { var source = new MvxSimpleTableViewSource(ticketsTabView, TicketViewCell.Key, TicketViewCell.Key); ticketsTabView.RowHeight = 60; ticketsTabView.Source = source; var bindingSet = this.CreateBindingSet <FindTicketsView, FindTicketsViewModel>(); bindingSet.Bind(source).To(vm => vm.Tickets); bindingSet.Apply(); ticketsTabView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(MailsTable, MailCellTemplate.Key, MailCellTemplate.Key); MailsTable.Source = source; var set = this.CreateBindingSet <FolderControl, FolderViewModel>(); set.Bind(source).To(vm => vm.Mails); set.Bind(source).For(s => s.SelectedItem).To(vm => vm.SelectedMail); set.Apply(); }
private void ConfigureTableView() { var Source = new MvxSimpleTableViewSource(TableView, IconCell.Key, IconCell.Key); TableView.Source = Source; var set = this.CreateBindingSet <ChooseIconView, ChooseIconViewModel>(); set.Bind(Source).To(vm => vm.Icons); set.Bind(Source).For(s => s.SelectionChangedCommand).To(vm => vm.ItemSelectedCommand); set.Apply(); TableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(TableView, typeof(CustomTableViewCell), nameof(CustomTableViewCell)); TableView.Source = source; TableView.RowHeight = 80f; var set = this.CreateBindingSet <ViewController, MainViewModel>(); set.Bind(source).For(v => v.ItemsSource).To(vm => vm.Images); set.Apply(); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. var source = new MvxSimpleTableViewSource(TableView, MenuCell.Key, MenuCell.Key); TableView.Source = source; var set = CreateBindingSet(); set.Bind(source).For(v => v.ItemsSource).To(vm => vm.MenuItems); set.Bind(source).For(v => v.SelectionChangedCommand).To(vm => vm.SelectMenuItemCommand); set.Apply(); }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(TableView, KittenCell.Key, KittenCell.Key); TableView.RowHeight = 100; TableView.Source = source; var set = this.CreateBindingSet <FirstView, FirstViewModel>(); set.Bind(source).To(vm => vm.Kittens); set.Apply(); TableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); var tableView = new UITableView(UIScreen.MainScreen.Bounds, UITableViewStyle.Plain); tableView.RowHeight = 150; Add(tableView); var source = new MvxSimpleTableViewSource(tableView, BillCell.Key, BillCell.Key); tableView.Source = source; this.CreateBinding(source).To((AllBillsViewModel vm) => vm.AllBills).Apply(); tableView.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(FoldersTable, FolderCellTemplate.Key, FolderCellTemplate.Key); FoldersTable.Source = source; var set = this.CreateBindingSet <FoldersView, FoldersViewModel>(); set.Bind(source).To(vm => vm.Folders); set.Bind(source).For(s => s.SelectedItem).To(vm => vm.SelectedFolder); set.Apply(); this.Title = "MailApp"; }
public override void ViewDidLoad() { base.ViewDidLoad(); var source = new MvxSimpleTableViewSource(UserListTabView, "UserList", UserViewCell.Key); UserListTabView.RowHeight = 130; UserListTabView.Source = source; var set = this.CreateBindingSet <UserList, UserListViewModel>(); set.Bind(source).To(vm => vm.UserList); set.Apply(); UserListTabView.ReloadData(); }