Пример #1
0
        //private void OnSizeChanged(object sender, EventArgs e)
        //{
        //    var page = (Xamarin.Forms.MasterDetailPage)sender;

        //    Control.ApplyTemplate();

        //    ConfigureSplitView(Control, page);

        //    page.SizeChanged -= OnSizeChanged;
        //}

        static void ConfigureSplitView(MasterDetailControl control, MasterDetailPage page)
        {
            try
            {
                if ((bool)page.GetValue(XamarinFormsGridView.Behaviours.MasterDetailPageBehaviour.IsDynamicMasterBehaviourEnabledProperty))
                {
                    var threshold = (double)page.GetValue(XamarinFormsGridView.Behaviours.MasterDetailPageBehaviour.DynamicMasterBehaviorThresholdProperty);

                    if (page.Width <= threshold)
                    {
                        //control.CollapseStyle = Xamarin.Forms.PlatformConfiguration.WindowsSpecific.CollapseStyle.Partial;
                        control.ShouldShowSplitMode = false;
                        control.IsPaneOpen          = false;
                    }
                    else
                    {
                        control.ShouldShowSplitMode = true;
                        control.IsPaneOpen          = true;
                    }
                }
            }
            catch (Exception)
            {
                //Not sure why this is getting thrown.
            }
        }
Пример #2
0
        public App()
        {
            Page page;

            InitializeComponent();
            if (App.UserSession == null)
            {
                App.UserSession = new ZCMobileSystemConfiguration {
                    SideContentVisibility = true
                };
            }

            if (Properties.ContainsKey(SelectedDataCenter))
            {
                App.UserSession.SelectedDataCenter = (string)Properties[SelectedDataCenter];
            }

            if (!string.IsNullOrEmpty(App.UserSession.SelectedDataCenter))
            {
                page = new LoginPage();
            }
            else
            {
                page = new MainPage();
            }

            App.Current.MainPage = MasterDetailControl.Create <MasterDetail, MasterDetailViewModel>(App.IsUSerLoggedIn, page);
            GetPageTitles();
        }
Пример #3
0
 public App()
 {
     InitializeComponent();
     ViewFactory.Init(Assembly.GetExecutingAssembly());
     MainPage   = MasterDetailControl.CreateMainPage <MasterDetail, MasterDetailViewModel>();
     Navigation = MainPage.Navigation;
 }
Пример #4
0
 public App()
 {
     InitializeComponent();
     MainPage = MasterDetailControl.Create<MasterDetail, MasterDetailViewModel>();
 }