Exemple #1
0
        public MainWindowVM()
        {
            ContentPageData buf = new ContentPageData(new NavMenuItemData()
            {
                IsDropdownItem = false, IsSelected = false
            },
                                                      "#appSettingsMenu",
                                                      "AppSettingsPageIcon",
                                                      PageKind.Settings,
                                                      new AppSettingsPage(),
                                                      ChangePage);

            PagesData.Add(buf);
            BottomItemSource.Add(buf.NavData);
            ChangePage(buf);

            buf = new ContentPageData(new NavMenuItemData()
            {
                IsDropdownItem = false, IsSelected = false
            },
                                      "#addBomberPageMenu",
                                      "AddBomberPageIcon",
                                      PageKind.Settings,
                                      (data) => { AddUserPage(new BomberPage(), new BomberPageVM(), "#NavMenuBomberPage", "BomberPageIcon"); });
            PagesData.Add(buf);
            BottomItemSource.Insert(0, buf.NavData);

            buf = new ContentPageData(new NavMenuItemData()
            {
                IsDropdownItem = false, IsSelected = false
            },
                                      "#addTransmitFilePageMenu",
                                      "AddTransmitFilePageIcon",
                                      PageKind.Settings,
                                      (data) => { AddUserPage(new TransmitFilePage(), new TransmitFilePageVM(), "#NavMenuTransmitFilePage", "TransmitFilePageIcon"); });
            PagesData.Add(buf);
            BottomItemSource.Insert(0, buf.NavData);

            buf = new ContentPageData(new NavMenuItemData()
            {
                IsDropdownItem = false, IsSelected = false
            },
                                      "#addTransmitPageMenu",
                                      "AddTransmitPageIcon",
                                      PageKind.Settings,
                                      (data) => { AddUserPage(new TransmitPage(), new TransmitPageVM(), "#NavMenuTransmitPage", "TransmitPageIcon"); });
            PagesData.Add(buf);
            BottomItemSource.Insert(0, buf.NavData);


            Settings.Instance.Proxies.CollectionChanged += OnProxiesCollectionChanged;
            Settings.Instance.PropertyChanged           += OnDevicePropertyChanged;
            PropertyChanged += TitleKey_PropertyChanged;

            Manager <LanguageCultureInfo> .StaticInstance.CultureChanged += Language_CultureChanged;
            Manager <ThemeCultureInfo> .StaticInstance.CultureChanged    += Theme_CultureChanged;

            TitleKey_PropertyChanged(this, new PropertyChangedEventArgs("TitleKey"));
        }
Exemple #2
0
        /// <summary>
        /// Delete page from navigation menu.
        /// </summary>
        /// <param name="page">Page which should be deleted</param>
        private void DelPageFromMenu(ContentPageData page)
        {
            MainContent = null;
            ResetSelectedItems();

            PagesData.Remove(page);
            TopItemSource.Remove(page.NavData);
            BottomItemSource.Remove(page.NavData);
            GC.Collect();
            TitleKey = "";
        }