Beispiel #1
1
 public App()
 {
     MainPage = new MasterDetailPage
     {
         Master = new ContentPage
         {
             Title = "Master",
             Content = new StackLayout
             {
                 Children =
                 {
                     new Label {Text = "Test 1"},
                     new Label {Text = "Test 2"}
                 }
             }
         },
         Detail = new TabbedPage
         {
             Children =
             {
                 new ContentPage {Title = "Page1", Content = new Label {Text = "Label page 1"} },
                 new ContentPage {Title = "Page2", Content = new Label {Text = "Label page 2"} },
                 new ContentPage {Title = "Page3", Content = new Label {Text = "Label page 3"} },
             }
         }
     };
 }
        static Layout CreateCollapseWidthAdjuster(Xamarin.Forms.MasterDetailPage page)
        {
            var label = new Label
            {
                Text = "Adjust Collapsed Width",
                VerticalTextAlignment = TextAlignment.Center,
                VerticalOptions       = LayoutOptions.Center
            };

            var entry = new Entry {
                Text = page.On <Windows>().CollapsedPaneWidth().ToString()
            };
            var button = new Button {
                Text = "Change", BackgroundColor = Color.Gray
            };

            button.Clicked += (sender, e) =>
            {
                double width;
                if (double.TryParse(entry.Text, out width))
                {
                    page.On <Windows>().CollapsedPaneWidth(width);
                }
            };

            return(new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Center,
                Children = { label, entry, button }
            });
        }
		public evaluacion (MasterDetailPage masterDetail, Usuario tusuario)
		{
			master = masterDetail;
			usuario = tusuario;

			var guardaritem = new ToolbarItem {
				Text = "Guardar"
			};
			guardaritem.Clicked += (object sender, System.EventArgs e) => 
			{
				guardarEvaluacion();
			};

			//ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
			ToolbarItems.Add(guardaritem);
			this.Title = "Evaluación del día";




			DateTime fecha = DateTime.Now;
			int dia = (int)fecha.DayOfWeek;
			if (dia == 0) {
				dia = 7;
			}
			diaselected= dia;
			dibuja (dia);

		}
		public AccionesDia (MasterDetailPage masterDetail, int tdia, Usuario tusuario)
		{
			usuario = tusuario;
			dia = tdia;

			var guardaritem = new ToolbarItem {
				Text = "Guardar"
			};
			guardaritem.Clicked += (object sender, System.EventArgs e) => 
			{
				guardarAcciones();
			};

			ToolbarItems.Add(guardaritem);
			this.Title = "Acciones ahorradoras";

			master = masterDetail;




			//End Dias


			cargarAcciones ();




		}
		public MenuPage (MasterDetailPage m)
		{
			master = m;

			Title = "Evolve13";
			Icon = "slideout.png";

			var section = new TableSection () {
				new MenuCell {Text = "Sessions", Host = this},
				new MenuCell {Text = "Speakers", Host = this},
				new MenuCell {Text = "Favorites", Host = this},
				new MenuCell {Text = "Room Plan", Host = this},
				new MenuCell {Text = "Map", Host = this},
				new MenuCell {Text = "About", Host = this},
			};

			var root = new TableRoot () {section} ;
		
			tableView = new MenuTableView ()
			{ 
				Root = root,
//				HeaderTemplate = new DataTemplate (typeof(MenuHeader)),
				Intent = TableIntent.Menu,
			};


			Content = new StackLayout {
				BackgroundColor = Color.Gray,
				VerticalOptions = LayoutOptions.FillAndExpand,
				Children = {tableView}
			};
		}
Beispiel #6
0
		public App ()
		{
			var md = new MasterDetailPage ();

			md.Master = new MenuPage (md);
			md.Detail = new NavigationPage(new SessionsPage ()) {Tint = App.NavTint};

			MainPage = md;
		}
		public static Page GetPage ()
		{
			var masterDetail = new MasterDetailPage ();
			var master = new MenuPage (masterDetail);

			masterDetail.Master = master;
			master.Selected (MenuOption.Home);
			return masterDetail;
		}
		public static Page GetMainPage ()
		{
			var md = new MasterDetailPage ();

			md.Master = new MenuPage (md);
			md.Detail = new NavigationPage(new SessionsPage ()) {Tint = App.NavTint};

			return md;
		}
        static Layout CreateCollapseStyleChanger(Xamarin.Forms.MasterDetailPage page)
        {
            var enumType = typeof(CollapseStyle);

            return(WindowsPlatformSpecificsHelpers.CreateChanger(enumType, Enum.GetName(enumType, page.On <Windows>().GetCollapseStyle()), picker =>
            {
                page.On <Windows>().SetCollapseStyle((CollapseStyle)Enum.Parse(enumType, picker.Items[picker.SelectedIndex]));
            }, "Select Collapse Style"));
        }
Beispiel #10
0
        public App()
        {
            MasterDetailPage = new MasterDetailPage {
                Master = new MenuPage (),
                Detail = new NavigationPage (new LinkPage ("A")),

            };
            MainPage = MasterDetailPage;
        }
        public XNavigationMasterDetailNavigator(XFrame rootFrame, MasterDetailPage page, IViewResolver viewResolver)
        {
            _rootFrame = rootFrame;
            _xNavigation = rootFrame.Navigation;
            _container = rootFrame.Container;
            _rootNavigationPage = page;
            _viewResolver = viewResolver;

            _configure();
        }
Beispiel #12
0
        public MainStack(IExtNavigationService navigationService, IExtDialogService dialogService, IPageService pageService): base(navigationService, dialogService, pageService)
        {
            NavigationPage = new NavigationPage();

            MainPage = new MasterDetailPage()
            {
                BackgroundColor = Color.Transparent,
                Master = BuildMenuPage(),
                Detail = NavigationPage
            };
        }
    public App()
    {
      InitializeComponent();

      var listviewTabbedPage = new TabbedPage();

      listviewTabbedPage.Children.Add(new ExtendedTextCellListview());
      listviewTabbedPage.Children.Add(new StackLayoutCell());

      var masterDetailPage = new MasterDetailPage();

      var menuItemListview = new ListView
      {
        ItemsSource = new List<string> { MenuItem.Listview, MenuItem.TableLayout, MenuItem.Styles }
      };

      menuItemListview.ItemSelected += (sender, args) =>
      {
        switch (args.SelectedItem.ToString())
        {
          case MenuItem.Listview:
            {
              masterDetailPage.Detail = listviewTabbedPage;
              masterDetailPage.IsPresented = false;
              return;
            }
          case MenuItem.TableLayout:
            {
              masterDetailPage.Detail = new ExtendedTextCellTableView();
              masterDetailPage.IsPresented = false;
              return;
            }
          case MenuItem.Styles:
            {
              masterDetailPage.Detail = new Styles();
              masterDetailPage.IsPresented = false;
              return;
            }

          default:
            {
              masterDetailPage.Detail = listviewTabbedPage;
              masterDetailPage.IsPresented = false;
              return;
            }
        }
      };

      masterDetailPage.Master = new ContentPage { Content = menuItemListview, Title = "Menu" };
      masterDetailPage.Detail = listviewTabbedPage;


      MainPage = masterDetailPage;
    }
		public Appl ()
		{
			var masterDetail = new MasterDetailPage ();
			var master = new MenuPage (masterDetail);

			masterDetail.Master = master;
			master.Selected (MenuOption.Home);


		
		}
Beispiel #15
0
        public MainStack()
        {
            NavigationPage = new NavigationPage();

            MainPage = new MasterDetailPage()
            {
                BackgroundColor = Color.Transparent,
                Master = BuildMenuPage(),
                Detail = NavigationPage
            };
        }
Beispiel #16
0
        public App()
        {
            MasterDetailPage = new MasterDetailPage
            {
                Master = new HomeScreenMenu(),

                //Detail = new NavigationPage(new LinkPage("A")),
                Detail = new NavigationPage(new View.HomeScreen()),
            };
            MainPage = MasterDetailPage;
        }
Beispiel #17
0
 public App()
 {
     InitializeComponent ();
     DB = new Database ();
     Client = new WooCommerceClient (Constants.baseStoreUrl, Constants.clientId, Constants.clientKey, DB);
     mdMain = new MasterDetailPage ();
     mdMain.Master = new MenuPage () {
         Icon = "nav_btn_md.png",
         Title = " "
     };
     mdMain.Detail = new BaseNavigationPage(new ProductsPage(),"GreenColor","AlmostWhite");
     MainPage = mdMain;
 }
Beispiel #18
0
 public App()
 {
     api = new Api ();
     MasterDetailPage = new MasterDetailPage {
         IsGestureEnabled = true,
         Master = new HelloMenuPage(),
         Detail = new NavigationPage(new HelloPage()),
     };
     NavigationPage.SetHasNavigationBar (this, false);
     MainPage = MasterDetailPage;
     //MainPage = MasterDetailPage;
     // The root page of your application
     //MainPage = new NavigationPage(new FastFood.MainPage());
 }
Beispiel #19
0
        public App()
        {
            EmployeeInfoData = new ObservableCollection<EmployeeInfo> ();

            MainPage = new MasterDetailPage () {
                Title = "Menu",
                Master = new MasterPage (),
                Detail = new NavigationPage( new TablePage ())
            };

            DBPath = "employeelist.db";

            var dataOps = new DataOperations (DBPath);
            EmployeeInfoData = dataOps.GetEmployees ();
        }
Beispiel #20
0
 private static ElementHandler CreateHandler(XF.Element parent, MobileBlazorBindingsRenderer renderer)
 {
     return(parent switch
     {
         XF.ContentPage contentPage => new ContentPageHandler(renderer, contentPage),
         XF.ContentView contentView => new ContentViewHandler(renderer, contentView),
         XF.Label label => new LabelHandler(renderer, label),
         XF.MasterDetailPage masterDetailPage => new MasterDetailPageHandler(renderer, masterDetailPage),
         XF.ScrollView scrollView => new ScrollViewHandler(renderer, scrollView),
         XF.ShellContent shellContent => new ShellContentHandler(renderer, shellContent),
         XF.Shell shell => new ShellHandler(renderer, shell),
         XF.ShellItem shellItem => new ShellItemHandler(renderer, shellItem),
         XF.ShellSection shellSection => new ShellSectionHandler(renderer, shellSection),
         XF.TabbedPage tabbedPage => new TabbedPageHandler(renderer, tabbedPage),
         _ => new ElementHandler(renderer, parent),
     });
Beispiel #21
0
        public MasterDetailPageHandler(NativeComponentRenderer renderer, XF.MasterDetailPage masterDetailPageControl) : base(renderer, masterDetailPageControl)
        {
            MasterDetailPageControl = masterDetailPageControl ?? throw new ArgumentNullException(nameof(masterDetailPageControl));

            // Set dummy Master and Detail because this element cannot be parented unless both are set.
            // https://github.com/xamarin/Xamarin.Forms/blob/ff63ef551d9b2b5736092eb48aaf954f54d63417/Xamarin.Forms.Core/MasterDetailPage.cs#L199
            // In Blazor, parents are created before children, whereas this doesn't appear to be the case in
            // Xamarin.Forms. Once the Blazor children get created, they will overwrite these dummy elements.

            // The Master page must have its Title set:
            // https://github.com/xamarin/Xamarin.Forms/blob/ff63ef551d9b2b5736092eb48aaf954f54d63417/Xamarin.Forms.Core/MasterDetailPage.cs#L72
            MasterDetailPageControl.Master = new XF.Page()
            {
                Title = "Title"
            };
            MasterDetailPageControl.Detail = new XF.Page();
        }
		public App ()
		{
			var detailContent = new ContentPage {BackgroundColor = Color.Green};
			var detailPage = new NavigationPage (detailContent);
			//detailPage.BarBackgroundColor = Color.Olive;
			detailPage.Title = "Some test";
			MasterDetailPage = new CustomMasterDetail {
				Master = new ContentPage{
					Title = "Some test",
					BackgroundColor = Color.Red
				},
				Detail = detailPage,
				Title = "Some test",
			};

			MainPage = MasterDetailPage;

		}
Beispiel #23
0
        public App()
        {
            var initialState = new ApplicationState
            {
                Todos = ImmutableArray<Todo>.Empty,
                Filter = TodosFilter.All
            };

            var masterDetail = new MasterDetailPage();

            Store = new Store<ApplicationState>(initialState, Reducers.ReduceApplication);

            masterDetail.Detail =
                new NavigationPage(
                    new MainPage() { Title = "Todo List" }
                );

            MainPage = masterDetail;
        }
Beispiel #24
0
        public acerca(MasterDetailPage masterDetail)
        {
            master = masterDetail;

            ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
            this.Title = "Acerca de..";

            RelativeLayout layout = new RelativeLayout ();

            //Colocar background
            var imgBackground = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.FondoAcciones.png"),
                Aspect = Aspect.AspectFill
            };

            layout.Children.Add (imgBackground,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height;
                }));

            var imgBackground2 = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.acercade2.png"),
                Aspect = Aspect.AspectFit
            };

            layout.Children.Add (imgBackground2,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height;
                }));

            Content = layout;
        }
Beispiel #25
0
        public MainStack(AppLoader appLoader)
        {
            _appLoader = appLoader;
            var color = Mobile.Helper.Color.Blue.ToFormsColor();
            NavigationPage = new NavigationPage()
            {
                BarBackgroundColor = color,
                BarTextColor = Mobile.Helper.Color.White.ToFormsColor(),
                Title = "Descubra"
            };

			MainPage = new MasterDetailPage()
			{
				BackgroundColor = Color.Transparent,
				Master = BuildMenuPage(),
				Detail = NavigationPage,
				MasterBehavior = MasterBehavior.Popover,
				IsGestureEnabled = false
            };
        }
Beispiel #26
0
        void setupMasterDetailPage(Taco t)
        {
            if (splitPage == null) {
                MainPage = new ContentPage();
                splitPage = new MasterDetailPage ();
                splitPage.Master = tacoNavigationPage;
            }

            TacoDetailPage tacoPage = new TacoDetailPage (t);
            tacoPage.Title = "";
            NavigationPage detailNavigation = new NavigationPage (tacoPage);
            detailNavigation.Title = "Taco";
            detailNavigation.BarBackgroundColor = Color.FromHex ("#15293c");
            detailNavigation.BarTextColor = Color.White;
            splitPage.Detail = detailNavigation;

            splitPage.Title = "Taco";

            MainPage = splitPage;
        }
		public AppearingGalleryPage ()
		{
			var initalPage = new AppearingPage (1);
			var initalPage2 = new AppearingPage (2);

			Content = new StackLayout { 
				Children = {
					new Button { Text = NavPageTitle, Command = new Command (() => {
						Application.Current.MainPage = new NavAppearingPage(initalPage);
						}) 
					},
					new Button { Text = MasterPageTitle, Command = new Command (() => {
						var page = new MasterDetailPage {
							Title = MasterPageTitle,
							Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
							Detail =  new NavAppearingPage(initalPage)
						};
						SetMainPage (page);
					})
					},
					new Button { Text = TabbedPageTitle, Command = new Command (() => {
						var page = new TabbedPage {
							Title = TabbedPageTitle,
							Children = { initalPage, initalPage2 }
						};
						SetMainPage (page);
					})
					},
					new Button { Text =  CarouselPageTitle, Command = new Command (() => {
						
						var page = new CarouselPage {
							Title = CarouselPageTitle,
							Children = { initalPage, initalPage2 }
						};
						SetMainPage (page);
					})
					}	
				}
			};
		}
Beispiel #28
0
		public App ()
		{
			var initialState = new ApplicationState {
				Todos = ImmutableArray<Todo>.Empty,
				Filter = TodosFilter.All
			};

//			//MainPage = new MainPage ();
//			NavigationPage navPage = new NavigationPage (
//				                         new DevFrame () {
//					TimeMachineStore = (IStore<TimeMachineState>)Store,
//					//Content = new TimeMachine(),
//				});
//
            var masterDetail = new MasterDetailPage ();

            bool enableTimeMachine = true;
            if (enableTimeMachine) {
                Store = new TimeMachineStore<ApplicationState> (initialState, ApplicationReducer.Execute);

                masterDetail.Master = 
                    new NavigationPage (
                        new DevFrame ((IStore<TimeMachineState>)Store) { 
                            Title = "Time Machine"
                        }
                    ) { Title = "Menu" };
                
            } else {
                Store = new Store<ApplicationState>(initialState, ApplicationReducer.Execute);
            }

            masterDetail.Detail = 
                new NavigationPage (
                    new MainPage () { Title = "Todo List" }
                );

            MainPage = masterDetail;
		}
        public MasterDetailPresenter(MvxViewModelRequest request)
        {
            this.masterDetailPage = new LokalReporterMasterDetailPage();
            this.menuPage = new MenuPage
            {
                Title = "Menu",
                BindingContext =
                    MvxPresenterHelpers.LoadViewModel(new MvxViewModelRequest(typeof (MenuViewModel), null, null, null))
            };
            this.masterDetailPage.Master = this.menuPage;

            var navigationPage = new MainPage();
            this.masterDetailPage.Detail = navigationPage;
            
            this.TryShow(request);

            Application.Current.MainPage = this.masterDetailPage;

            navigationPage.Popped +=
                (sender, args) => this.NavigationPageOnNavigated(sender, args, NavigationEventType.Popped);
            navigationPage.Pushed +=
                (sender, args) => this.NavigationPageOnNavigated(sender, args, NavigationEventType.Pushed);
        }
        public void LoadMultipleNavigation()
        {
            var masterDetailsMultiple = new MasterDetailPage (); //generic master detail page

            //we setup the first navigation container with ContactList
            var contactListPage = FreshPageModelResolver.ResolvePageModel<ContactListPageModel> ();
            contactListPage.Title = "Contact List";
            //we setup the first navigation container with name MasterPageArea
            var masterPageArea = new FreshNavigationContainer (contactListPage, "MasterPageArea");
            masterPageArea.Title = "Menu";

            masterDetailsMultiple.Master = masterPageArea; //set the first navigation container to the Master

            //we setup the second navigation container with the QuoteList
            var quoteListPage = FreshPageModelResolver.ResolvePageModel<QuoteListPageModel> ();
            quoteListPage.Title = "Quote List";
            //we setup the second navigation container with name DetailPageArea
            var detailPageArea = new FreshNavigationContainer (quoteListPage, "DetailPageArea");

            masterDetailsMultiple.Detail = detailPageArea; //set the second navigation container to the Detail

            MainPage = masterDetailsMultiple;
        }
Beispiel #31
0
        public App()
        {
            var items =
                Device.OS == TargetPlatform.iOS ? Demos.SamplesForPlatform(Demos.Platform.iOS) :
                Device.OS == TargetPlatform.Android ? Demos.SamplesForPlatform(Demos.Platform.Android) :
                Device.OS == TargetPlatform.Windows ? Demos.SamplesForPlatform(Demos.Platform.UWP) :
                Demos.SamplesForPlatform(Demos.Platform.All);

            var masterDetail = new MasterDetailPage
            {
                IsGestureEnabled = true,
                MasterBehavior = MasterBehavior.Popover
            };
            var detailPage = new DetailsPage(items.First());
            var navPage = new NavigationPage(detailPage)
            {
                BarBackgroundColor = XamarinBlue,
                BarTextColor = Color.White,
            };
            var masterPage = new MasterPage(items, demo =>
            {
                masterDetail.IsPresented = false;
                detailPage.SetDemo(demo);
                navPage.Title = demo;
            });
            if (Device.OS == TargetPlatform.iOS)
            {
                masterPage.Icon = "hamburger.png";
            }

            masterDetail.Master = masterPage;
            masterDetail.Detail = navPage;

            MainPage = masterDetail;

            masterDetail.IsPresented = true;
        }
Beispiel #32
0
        public App() {
			Globals.Ideas = new IdeasPage ();
			Globals.Program = new ProgramPage ();
			Globals.Location = new LocationPage ();
			Globals.Links = new LinksPage ();
			Globals.SponsorsP = new SponsorsPage ();
			Globals.SpeakerPages = new Dictionary<int, SpeakerPage> ();
			Globals.SectionPages = new Dictionary<string, SectionPage> ();
			Globals.HostPages = new Dictionary<int, HostPage> ();
			
			var newMaster = new MasterDetailPage {
				Detail = new NavigationPage(Globals.Ideas) { 
					BarBackgroundColor= Color.Black,//Color.FromHex("FFFF2B06"),
					//BarTextColor = Color.Black
				},
				Master = new MenuPage {
					Title = "Programa2",
					Icon = "noun_89650.png"
				},
				IsGestureEnabled = false,
			};
			MainPage = App.Current.MainPage = (Globals.MasterPage = newMaster);

        }
Beispiel #33
0
		public MenuPage (MasterDetailPage masterDetail)
		{
			Items = new ObservableCollection<MenuItem> ();
			Items.Add (new MenuItem{ Title = "На главную", Option = MenuOption.Home });
			Items.Add (new MenuItem{ Title = "Добавить новую", Option = MenuOption.Add_new });
			Items.Add (new MenuItem{ Title = "Профиль", Option = MenuOption.Profile });
            Items.Add(new MenuItem { Title = "Избранное", Option = MenuOption.Favorites });
            Items.Add(new MenuItem { Title = "Настройки", Option = MenuOption.Settings });
            Items.Add(new MenuItem { Title = "Выход", Option = MenuOption.Exit });

            master = masterDetail;

			Title = "menu";
			Icon = "ic_drawer_dark.png";
			BackgroundColor = Color.FromHex ("111111");

			var listView = new ListView {
				RowHeight = 60,
				VerticalOptions = LayoutOptions.FillAndExpand,
				ItemTemplate = new DataTemplate (typeof(MenuCell)),
				ItemsSource = Items
			};

			listView.ItemSelected += (sender, e) => {

				var item = e.SelectedItem as MenuItem;
				if (item == null)
					return;

				Selected (item.Option);

				listView.SelectedItem = null;//clear out
			};

			Content = listView;
		}
Beispiel #34
0
 public static MasterDetailPageEvents Events(this MasterDetailPage This)
 {
     return(new MasterDetailPageEvents(This));
 }
Beispiel #35
0
 public MasterDetailPageEvents(MasterDetailPage This)
     : base(This)
 {
     this.This = This;
 }
Beispiel #36
0
        public MasterDetailPageHandler(NativeComponentRenderer renderer, XF.MasterDetailPage masterDetailPageControl) : base(renderer, masterDetailPageControl)
        {
            MasterDetailPageControl = masterDetailPageControl ?? throw new ArgumentNullException(nameof(masterDetailPageControl));

            Initialize(renderer);
        }
 public static void SetMainPage(MasterDetailPage mainPage)
 {
     NavigationExtensions.mainPage = mainPage;
 }
Beispiel #38
-1
		public App ()
		{

			master = new MasterDetailPage ();

			master.Title = "HealthLite";

			master.Master = new Home ();

			master.Detail = new ContentPage ();

			if (!App.Current.Properties.ContainsKey ("login")) {

				//master.MasterBehavior = MasterBehavior.Popover;
				//master.IsGestureEnabled = false;
				master.Detail = new NavigationPage (new Home ());
			} else {
				//master.MasterBehavior = MasterBehavior.Default;
				//master.IsGestureEnabled = true;
				//home de login
				master.Master = new Home ();

				master.Detail = new NavigationPage (new Report());
			}

			MainPage = master; 

		}