/* * * * * * * * * * * * * * * * * */ /* * * * * * Constructor * * * * * * */ public ConferenceSurveyView() { BaseViewModel.CreateAndBind <ConferenceSurveyViewModel> (this); Title = "Conference Survey"; var surveyCompletedView = CreateSurveyCompletedView(); surveyCompletedView.SetBinding(StackLayout.IsVisibleProperty, "SurveyExists"); var surveyIncompleteView = CreateSurveyIncompleteView(); surveyIncompleteView.SetBinding(View.IsVisibleProperty, "SurveyExists", converter: new NegateValueConverter()); SetBinding(ConferenceSurveyView.SurveyExistsProperty, new Binding("SurveyExists")); SetBinding(AlertProperty, new Binding("AlertMessage")); MessagingCenter.Subscribe <ConferenceSurveyViewModel> (this, "DismissKeyboard", delegate { }); Content = new StackLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Children = { surveyCompletedView, surveyIncompleteView } }; }
public QrCodeScannerView() { BaseViewModel.CreateAndBind <QrCodeScannerViewModel> (this); Title = "Swap Contacts"; NavigationPage.SetBackButtonTitle(this, ""); // This view will be rendered natively }
public ContactView(Contact contact) { BaseViewModel.CreateAndBind <ContactViewModel> (this, contact); Title = "Contact"; _contact = contact; Content = CreateView(); }
public FiltersView() { BaseViewModel.CreateAndBind <FiltersViewModel> (this); Title = "Filters"; NavigationPage.SetBackButtonTitle(this, ""); this.ToolbarItems.Add(CreateClearButton()); Content = CreateTrackFilterListView(); }
public HomeView() { BaseViewModel.CreateAndBind <HomeViewModel> (this); Title = "Couchbase Connect"; NavigationPage.SetBackButtonTitle(this, ""); SetBinding(HomeView.NavigationProperty, new Binding("Navigation")); var relativeLayout = new RelativeLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; var currentSessionsCarousel = CreateCurrentSessionsCarousel(); relativeLayout.Children.Add(currentSessionsCarousel, Constraint.RelativeToParent((parent) => { return(parent.X); }), Constraint.RelativeToParent((parent) => { return(parent.Y); }), Constraint.RelativeToParent((parent) => { return(parent.Width); }), Constraint.Constant(175) ); relativeLayout.Children.Add(CreateTweetList(), Constraint.RelativeToParent((parent) => { return(parent.X); }), Constraint.RelativeToView(currentSessionsCarousel, (parent, sibling) => { return(sibling.Height); }), Constraint.RelativeToParent((parent) => { return(parent.Width); }), Constraint.RelativeToParent((parent) => { return(parent.Height - 175); }) ); relativeLayout.Children.Add(CreateActivityIndicator(), Constraint.RelativeToParent((parent) => { return((parent.Width / 2) - 25); }), Constraint.RelativeToView(currentSessionsCarousel, (parent, sibling) => { return((sibling.Height / 2) + (parent.Height / 2) - 25); }), Constraint.Constant(50), Constraint.Constant(50) ); relativeLayout.Children.Add(CreateTimeOutView(), Constraint.RelativeToParent((parent) => { return(parent.X); }), Constraint.RelativeToView(currentSessionsCarousel, (parent, sibling) => { return(sibling.Height); }), Constraint.RelativeToParent((parent) => { return(parent.Width); }), Constraint.RelativeToView(currentSessionsCarousel, (parent, sibling) => { return(parent.Height - sibling.Height); }) ); relativeLayout.Children.Add(CreatePipsContainer(), Constraint.Constant(0), Constraint.RelativeToView(currentSessionsCarousel, (parent, sibling) => { return(sibling.Height - 18); }), Constraint.RelativeToParent(parent => parent.Width), Constraint.Constant(18) ); Content = relativeLayout; }
public ChooseSessionView(Slot slot, Session session) { BaseViewModel.CreateAndBind <ChooseSessionViewModel> (this, slot, session); NavigationPage.SetBackButtonTitle(this, ""); ToolbarItems.Add(CreateSelectButton()); SetBinding(ChooseSessionView.NavigationProperty, new Binding("Navigation")); SetBinding(ChooseSessionView.TitleProperty, new Binding("Title")); SetBinding(ChooseSessionView.SelectButtonTextProperty, new Binding("SelectButtonText")); var relativeLayout = new RelativeLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; var lowerStackLayout = new StackLayout { HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.EndAndExpand, Spacing = 20, Padding = new Thickness(0, 20, 0, 20), }; lowerStackLayout.Children.Add(CreatePips()); lowerStackLayout.Children.Add(CreateRateButton()); relativeLayout.Children.Add(lowerStackLayout, Constraint.RelativeToParent((parent) => { return(parent.X); }), Constraint.RelativeToParent((parent) => { return(parent.Height - 100); }), Constraint.RelativeToParent((parent) => { return(parent.Width); }) ); sessionInfoCarousel = CreateSessionInfoCarousel(); relativeLayout.Children.Add(sessionInfoCarousel, Constraint.RelativeToParent((parent) => { return(parent.X); }), Constraint.RelativeToParent((parent) => { return(parent.Y); }), Constraint.RelativeToParent((parent) => { return(parent.Width); }), Constraint.RelativeToView(lowerStackLayout, (parent, sibling) => { return(parent.Height - sibling.Height); }) ); var fadeOut = CreateFadeOut(); relativeLayout.Children.Add(fadeOut, Constraint.RelativeToParent(parent => { return(parent.X); }), Constraint.RelativeToView(lowerStackLayout, (parent, sibling) => { return(sibling.Y - 30); }), Constraint.RelativeToParent(parent => { return(parent.Width); }), Constraint.Constant(40) ); Content = relativeLayout; }
public ContactsView() { BaseViewModel.CreateAndBind <ContactsViewModel> (this); SetBinding(ContactsView.NavigationProperty, new Binding("Navigation")); SetBinding(AlertProperty, new Binding("AlertMessage")); Title = "Contacts"; NavigationPage.SetBackButtonTitle(this, ""); var addContactButton = new ToolbarItem { Icon = "plus.png", Name = "Add Contact", }; addContactButton.SetBinding <ContactsViewModel> (ToolbarItem.CommandProperty, vm => vm.AddContactCommand); this.ToolbarItems.Add(addContactButton); var relativeLayout = new RelativeLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; var searchBar = CreateSearchBar(); relativeLayout.Children.Add(searchBar, Constraint.RelativeToParent((parent) => { return(parent.X); }), Constraint.RelativeToParent((parent) => { return(parent.Y); }), Constraint.RelativeToParent((parent) => { return(parent.Width); }) ); _listView = CreateList(); relativeLayout.Children.Add(_listView, Constraint.RelativeToParent((parent) => { return(parent.X); }), Constraint.RelativeToView(searchBar, (parent, sibling) => { return(sibling.Height); }), Constraint.RelativeToParent((parent) => { return(parent.Width); }), Constraint.RelativeToView(searchBar, (parent, sibling) => { return(parent.Height - sibling.Height); }) ); var gettingStarted = CreateGettingStartedView(); relativeLayout.Children.Add(gettingStarted, Constraint.RelativeToParent((parent) => { return(parent.X); }), Constraint.RelativeToParent((parent) => { return((parent.Height / 2) - 100); }), Constraint.RelativeToParent((parent) => { return(parent.Width); }), Constraint.RelativeToParent((parent) => { return(parent.Height - 175); }) ); Content = relativeLayout; }
public AgendaView() { BaseViewModel.CreateAndBind <AgendaViewModel> (this); Title = "My Agenda"; BackgroundColor = Color.Default; NavigationPage.SetBackButtonTitle(this, ""); SetBinding(NavigationProperty, new Binding("Navigation")); this.ToolbarItems.Add(CreateFullScheduleItem()); Content = CreateRootStack(); }
public FullScheduleView() { BaseViewModel.CreateAndBind <FullScheduleViewModel> (this); SetBinding(FullScheduleView.NavigationProperty, new Binding("Navigation")); Title = "Full Schedule"; BackgroundColor = Color.Default; NavigationPage.SetBackButtonTitle(this, ""); this.ToolbarItems.Add(CreateFiltersItem()); SetBinding(ToolbarIconProperty, new Binding("FilterIcon")); Content = CreateRootStack(); }
public ScavengerHuntCaptureView(Models.ScavengerHuntView item) { BaseViewModel.CreateAndBind <ScavengerHuntCaptureViewModel> (this, item); SetBinding(ScavengerHuntCaptureView.NavigationProperty, new Binding("Navigation")); Title = "Found Something?"; NavigationPage.SetBackButtonTitle(this, ""); HuntItem = item; SetBinding(CameraContentPage.IsPresentedProperty, new Binding("CameraIsPresented", BindingMode.TwoWay)); SetBinding(CameraContentPage.CapturedImageProperty, new Binding("CameraImage", BindingMode.TwoWay)); var relativeLayout = new RelativeLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand }; var needStack = CreateNeedStack(); relativeLayout.Children.Add(needStack, Constraint.RelativeToParent(parent => { return(parent.X); }), Constraint.RelativeToParent(parent => { return(parent.Y); }), Constraint.RelativeToParent(parent => { return(parent.Width); }), Constraint.RelativeToParent(parent => { return((parent.Height / 2) - 0.25); }) ); var separator = CreateSeparator(); relativeLayout.Children.Add(separator, Constraint.RelativeToParent(parent => { return(parent.X); }), Constraint.RelativeToView(needStack, (parent, sibling) => { return(sibling.Height); }), Constraint.RelativeToParent(parent => { return(parent.Width); }), Constraint.Constant(0.5) ); var haveStack = CreateHaveStack(); relativeLayout.Children.Add(haveStack, Constraint.RelativeToParent(parent => { return(parent.X); }), Constraint.RelativeToView(separator, (parent, sibling) => { return(sibling.Y + sibling.Height); }), Constraint.RelativeToParent(parent => { return(parent.Width); }), Constraint.RelativeToParent(parent => { return((parent.Height / 2) - 0.25); }) ); Content = relativeLayout; }
public MenuView() { BaseViewModel.CreateAndBind <MenuViewModel> (this); Title = "Couchbase Connect"; Icon = "menu.png"; BackgroundColor = Colors.MenuBackground; Content = new StackLayout { VerticalOptions = LayoutOptions.StartAndExpand, Children = { CreateTopRow(), CreateListView() } }; }
public ProfileView() { BaseViewModel.CreateAndBind <ProfileViewModel> (this); SetBinding(ProfileView.NavigationProperty, new Binding("Navigation")); Title = "Profile"; NavigationPage.SetBackButtonTitle(this, ""); var edit = new ToolbarItem(); edit.Name = "Edit"; edit.SetBinding <ProfileViewModel> (ToolbarItem.CommandProperty, vm => vm.EditProfileCommand); this.ToolbarItems.Add(edit); Content = CreateStack(); }
// public string Success { // get { // return (string)GetValue (SuccessProperty); // } // set { // SetValue (SuccessProperty, value); // } // } // // public static readonly BindableProperty SuccessProperty = // BindableProperty.Create<EditProfileView, string>(b => b.Success, null, // propertyChanged: async (bindable, oldValue, newValue) => { // if(newValue == null) // return; // var view = (EditProfileView)bindable; // await view.DisplayAlert ("Success", newValue, null, "Okay"); // ((EditProfileViewModel)view.BindingContext).SuccessMessage = null; // }); public EditProfileView() { BaseViewModel.CreateAndBind <EditProfileViewModel> (this); SetBinding(EditProfileView.NavigationProperty, new Binding("Navigation")); SetBinding(AlertProperty, new Binding("AlertMessage")); // SetBinding(SuccessProperty, new Binding("SuccessMessage")); Title = "Profile"; NavigationPage.SetBackButtonTitle(this, ""); var save = new ToolbarItem(); save.Name = "Save"; save.SetBinding <EditProfileViewModel> (ToolbarItem.CommandProperty, vm => vm.SaveProfileCommand); this.ToolbarItems.Add(save); Content = CreateStack(); }
/* * * * * * * * * * * * * * * * */ public RateSessionView(string sessionId) { BaseViewModel.CreateAndBind <RateSessionViewModel> (this, sessionId); Title = "Rate Session"; NavigationPage.SetBackButtonTitle(this, ""); SetBinding(NavigationProperty, new Binding("Navigation")); var doneButton = new ToolbarItem { Name = "Done" }; doneButton.SetBinding(ToolbarItem.CommandProperty, "SaveRating"); this.ToolbarItems.Add(doneButton); SetBinding(AlertProperty, new Binding("AlertMessage")); Content = CreateStack(); }
public ScavengerHuntView() { BaseViewModel.CreateAndBind <ScavengerHuntViewModel> (this); Title = "Scavenger Hunt"; NavigationPage.SetBackButtonTitle(this, ""); SetBinding(HomeView.NavigationProperty, new Binding("Navigation")); _listView = CreateListView(); Content = new StackLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Spacing = 0, Children = { CreateHeader(), CreateSeparator(), _listView } }; }