Example #1
0
        private void M_PageRoot_IsPresentedChanged(object sender, EventArgs e)
        {
            MasterDetailPage page = sender as MasterDetailPage;

            if (page.IsPresented)
            {
                Pages.PageMenu menu = (Pages.PageMenu)page.Master;
                menu.ProjectSettingsChanged();
            }
        }
Example #2
0
        public App()
        {
            InitializeComponent();

            if (!DesignMode.IsDesignModeEnabled)
            {
                // Don't run in the Previewer

                //ApplyAccentColor((Color)Resources["UIAccent"]);
                //Theming.ChangeTheme(Theming.Themes.Comos);

                // register some services.
                var db = Services.XServices.Instance.GetService <Services.IDatabase>();
                Services.XServices.Instance.AddService <Services.XDatabase>(
                    new Services.XDatabase(db));
                string theme = db.ReadSetting("Theme", "Siemens");
                Theming.ChangeTheme(theme);

                if (Device.RuntimePlatform != Device.UWP)
                {
                    // For android needs to be done here.
                    App.WidthPixels  = Services.XServices.Instance.GetService <Services.IPlatformSystem>().GetScreenWidthPixels;
                    App.HeightPixels = Services.XServices.Instance.GetService <Services.IPlatformSystem>().GetScreenHeightPixels;
                    App.PixelDensity = Services.XServices.Instance.GetService <Services.IPlatformSystem>().GetScreenDensity;
                }
                else
                {
                    App.PixelDensity = 1;
                }
                App.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label));
                var web      = Services.XServices.Instance.GetService <ComosWebSDK.IComosWeb>();
                var menuPage = new Pages.PageMenu(web);


                Navigation               = new NavigationPage(new Pages.PageLogin());
                Navigation.Popped       += Navigation_Popped;
                Navigation.PoppedToRoot += Navigation_PoppedToRoot;
                m_PageRoot               = new Pages.PageRoot();
                m_PageRoot.Master        = menuPage;
                m_PageRoot.Detail        = Navigation;
                MainPage = m_PageRoot;

                m_PageRoot.IsPresentedChanged += M_PageRoot_IsPresentedChanged;

                if (Device.RuntimePlatform == Device.UWP)
                {
                    MainPage.Appearing += MainPage_Appearing;
                }
            }
        }