Пример #1
0
        private void CustomTopBar_OnMenuContentTypeActivated(object sender, bool e)
        {
            if (e)
            {
                var alert = UIAlertController.Create("Wybierz treści", "", UIAlertControllerStyle.Alert);
                alert.AddAction(UIAlertAction.Create("Bydgoszcz 1920", UIAlertActionStyle.Default,
                                                     action =>
                {
                    ChangeContentType(ContentType.Bydgoszcz1920);
                    CustomTopBar.SetContentTypeTitle(ContentType.Bydgoszcz1920);
                    SideMenuControl.SetSideMenuSubHeader(ContentType.Bydgoszcz1920);
                    TextViewDescription.Text = AppStrings.ContentDescription_Bydgoszcz1920 + AppStrings.Main_Introduction;

                    if (CurrentPageTitle == "Główna")
                    {
                        SideMenuVisibility = true;
                    }
                }));
                alert.AddAction(UIAlertAction.Create("Bydgoszcz 1945", UIAlertActionStyle.Default,
                                                     action =>
                {
                    ChangeContentType(ContentType.Bydgoszcz1945);
                    CustomTopBar.SetContentTypeTitle(ContentType.Bydgoszcz1945);
                    SideMenuControl.SetSideMenuSubHeader(ContentType.Bydgoszcz1945);
                    TextViewDescription.Text = AppStrings.ContentDescription_Bydgoszcz1945 + AppStrings.Main_Introduction;

                    if (CurrentPageTitle == "Główna")
                    {
                        SideMenuVisibility = true;
                    }
                }));
                alert.AddAction(UIAlertAction.Create("Marian Rejewski", UIAlertActionStyle.Default,
                                                     action =>
                {
                    ChangeContentType(ContentType.MarianRejewski);
                    CustomTopBar.SetContentTypeTitle(ContentType.MarianRejewski);
                    SideMenuControl.SetSideMenuSubHeader(ContentType.MarianRejewski);
                    TextViewDescription.Text = AppStrings.ContentDescription_MarianRejewski + AppStrings.Main_Introduction;

                    if (CurrentPageTitle == "Główna")
                    {
                        SideMenuVisibility = true;
                    }
                }));

                alert.AddAction(UIAlertAction.Create("Anuluj", UIAlertActionStyle.Cancel,
                                                     action => {  }));
                PresentViewController(alert, true, null);
            }
        }
Пример #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var path = (string)value;

            if (path == null)
            {
                return(null);
            }
            var name  = SideMenuControl.GetFileFolderName(path);
            var image = "Images/Directory/FileIcon.png";

            if (string.IsNullOrEmpty(name))
            {
                image = "Images/Directory/DriveIcon.png";
            }
            else if (new FileInfo(path).Attributes.HasFlag(FileAttributes.Directory))
            {
                image = "Images/Directory/FolderIcon.png";
            }


            return(new BitmapImage(new Uri($"pack://application:,,,/{image}")));
        }
Пример #3
0
        //CONSTRUCTOR!!!
        public MainWindowVM(Window window)
        {
            mainWindow = window;

            mainWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            mainWindow.WindowState           = WindowState.Normal;
            mainWindow.Opacity = 0;

            mainWindow.Cursor = CustomCursors.Normal_Select;

            //Init loading window
            loadingWindow = new LoadingWindow();
            loadingWindow.Show();
            loadingWindow.Closed += LoadingWindow_Closed;

            //Models init
            Task.Run(() =>
            {
                BasicNetInterfaceDataHub = new NetworkDataHub(BasicInterfaceTypes.ToArray());
                BasicSystemDataHub       = new SystemDataHub();
            });

            //Searching elements
            mainWindow.ApplyTemplate();
            titleLine         = (Grid)mainWindow.Template.FindName("TitleLine", mainWindow);
            windowNeon        = (DropShadowEffect)mainWindow.Template.FindName("WindowNeon", mainWindow);
            maxSizeButton     = (Button)mainWindow.Template.FindName("MaxSizeButton", mainWindow);
            minSizeButton     = (Button)mainWindow.Template.FindName("MinSizeButton", mainWindow);
            closeWindowButton = (Button)mainWindow.Template.FindName("CloseWindowButton", mainWindow);
            pagesViewer       = (Frame)mainWindow.FindName("PagesViewer");
            sideMenu          = (SideMenuControl)mainWindow.FindName("SideMenu");
            nextPageButton    = (Button)sideMenu.Template.FindName("NextButton", sideMenu);
            prevPageButton    = (Button)sideMenu.Template.FindName("PrevButton", sideMenu);
            homeButton        = (Button)sideMenu.Template.FindName("HomeButton", sideMenu);

            //Menu buttons click events connect
            foreach (Button menuButton in (sideMenu.Content as StackPanel).Children)
            {
                menuButton.Click += ChangeMenuSelection;
            }

            //Navigate buttons init
            nextPageButton.IsEnabled = false;
            prevPageButton.IsEnabled = false;

            //Commands time!
            CommandsInit();

            //Pages array init
            Pages = new Page[3];

            //PagesViewer init
            DoubleAnimation OpenAnim = new DoubleAnimation(1, new Duration(new TimeSpan(0, 0, 0, 0, 750)));

            welcomePage            = new WelcomePage();
            welcomePage.MouseDown += WelcomePage_MouseDown;

            pagesViewer.JournalOwnership = JournalOwnership.OwnsJournal;
            pagesViewer.Content          = welcomePage;
            pagesViewer.Navigated       += PagesViewer_Navigated;
            welcomePage.BeginAnimation(Page.OpacityProperty, OpenAnim);
            WelcomePageON = true;

            //Window events binding
            mainWindow.StateChanged += MainWindow_StateChanged;
            mainWindow.Loaded       += MainWindow_Loaded;
            mainWindow.MouseEnter   += MainWindow_MouseEnter;
            mainWindow.MouseLeave   += MainWindow_MouseLeave;
        }
Пример #4
0
        void ReleaseDesignerOutlets()
        {
            if (AuthorContainerView != null)
            {
                AuthorContainerView.Dispose();
                AuthorContainerView = null;
            }

            if (CuriositiesContainerView != null)
            {
                CuriositiesContainerView.Dispose();
                CuriositiesContainerView = null;
            }

            if (CustomTopBar != null)
            {
                CustomTopBar.Dispose();
                CustomTopBar = null;
            }

            if (ImageViewBackground != null)
            {
                ImageViewBackground.Dispose();
                ImageViewBackground = null;
            }

            if (MainViewWrapper != null)
            {
                MainViewWrapper.Dispose();
                MainViewWrapper = null;
            }

            if (MediaContainerView != null)
            {
                MediaContainerView.Dispose();
                MediaContainerView = null;
            }

            if (MuseumContainerView != null)
            {
                MuseumContainerView.Dispose();
                MuseumContainerView = null;
            }

            if (PhotosContainerView != null)
            {
                PhotosContainerView.Dispose();
                PhotosContainerView = null;
            }

            if (SideMenuControl != null)
            {
                SideMenuControl.Dispose();
                SideMenuControl = null;
            }

            if (SideMenuControlLeadingConstraint != null)
            {
                SideMenuControlLeadingConstraint.Dispose();
                SideMenuControlLeadingConstraint = null;
            }

            if (TextViewDescription != null)
            {
                TextViewDescription.Dispose();
                TextViewDescription = null;
            }

            if (ViewSideMenuOverlay != null)
            {
                ViewSideMenuOverlay.Dispose();
                ViewSideMenuOverlay = null;
            }

            if (ViewTopBarOverlay != null)
            {
                ViewTopBarOverlay.Dispose();
                ViewTopBarOverlay = null;
            }

            if (ViewPreviewContentTypeOverlay != null)
            {
                ViewPreviewContentTypeOverlay.Dispose();
                ViewPreviewContentTypeOverlay = null;
            }
        }