예제 #1
0
 private void FModel_MI_Settings_ThemeCreator_Click(object sender, RoutedEventArgs e)
 {
     DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Window]", "Opening Challenge Bundles Creator Settings");
     if (!FWindows.IsWindowOpen <Window>(Properties.Resources.ChallengesThemeCreator))
     {
         new ChallengeBundlesCreator().Show();
     }
     else
     {
         FWindows.GetOpenedWindow <Window>(Properties.Resources.ChallengesThemeCreator).Focus();
     }
 }
예제 #2
0
 private void FModel_MI_Help_About_Click(object sender, RoutedEventArgs e)
 {
     DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Window]", "Opening About");
     if (!FWindows.IsWindowOpen <Window>(Properties.Resources.AboutF))
     {
         new FAbout().Show();
     }
     else
     {
         FWindows.GetOpenedWindow <Window>(Properties.Resources.AboutF).Focus();
     }
 }
예제 #3
0
 private void FModel_MI_Assets_ImageMerger_Click(object sender, RoutedEventArgs e)
 {
     DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Window]", "Opening Images Merger Settings");
     if (!FWindows.IsWindowOpen <Window>(Properties.Resources.ImagesMerger))
     {
         new ImagesMerger().Show();
     }
     else
     {
         FWindows.GetOpenedWindow <Window>(Properties.Resources.ImagesMerger).Focus();
     }
 }
예제 #4
0
 private void FModel_MI_Settings_General_Click(object sender, RoutedEventArgs e)
 {
     DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Window]", "Opening General Settings");
     if (!FWindows.IsWindowOpen <Window>(Properties.Resources.GeneralSettings))
     {
         new General().Show();
     }
     else
     {
         FWindows.GetOpenedWindow <Window>(Properties.Resources.GeneralSettings).Focus();
     }
 }
예제 #5
0
 private void FModel_MI_Assets_AudioPlayer_Click(object sender, RoutedEventArgs e)
 {
     DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Window]", "Opening Audio Player");
     if (!FWindows.IsWindowOpen <Window>(Properties.Resources.AudioPlayer))
     {
         new AudioPlayer(); //no need to show, Show() is already in the constructor
     }
     else
     {
         FWindows.GetOpenedWindow <Window>(Properties.Resources.AudioPlayer).Focus();
     }
 }
예제 #6
0
 private void FModel_MI_Files_AES_Click(object sender, RoutedEventArgs e)
 {
     DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Window]", "Opening AES Manager");
     if (!FWindows.IsWindowOpen <Window>(Properties.Resources.AES))
     {
         new AESManager().Show();
     }
     else
     {
         FWindows.GetOpenedWindow <Window>(Properties.Resources.AES).Focus();
     }
 }
예제 #7
0
        public static void OpenImage(this ImageBoxViewModel vm)
        {
            if (vm.Image != null)
            {
                DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Window]", $"Opening image of {vm.Name}");
                if (!FWindows.IsWindowOpen <Window>(vm.Name))
                {
                    Window win = new Window
                    {
                        Title = vm.Name,
                        WindowStartupLocation = WindowStartupLocation.CenterScreen,
                        Width  = vm.Image.Width,
                        Height = vm.Image.Height
                    };
                    win.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display);
                    if (vm.Image.Height > 1000)
                    {
                        win.WindowState = WindowState.Maximized;
                    }

                    DockPanel dockPanel = new DockPanel
                    {
                        HorizontalAlignment = HorizontalAlignment.Center,
                        VerticalAlignment   = VerticalAlignment.Center,
                    };

                    Image img = new Image
                    {
                        UseLayoutRounding = true,
                        Source            = vm.Image
                    };
                    dockPanel.Children.Add(img);

                    win.Content = dockPanel;
                    win.Show();
                }
                else
                {
                    FWindows.GetOpenedWindow <Window>(vm.Name).Focus();
                }
            }
        }
예제 #8
0
 private void FModel_MI_Assets_Search_Click(object sender, RoutedEventArgs e)
 {
     DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Window]", "Opening Searcher");
     if (!FWindows.IsWindowOpen <Window>(Properties.Resources.Search))
     {
         new Search().Show();
     }
     else
     {
         Window openedWindow = FWindows.GetOpenedWindow <Window>(Properties.Resources.Search);
         if (openedWindow.WindowState == WindowState.Minimized)
         {
             openedWindow.WindowState = WindowState.Normal;
         }
         else
         {
             openedWindow.Focus();
         }
     }
 }
예제 #9
0
        private void OnOpenImageBtn_Click(object sender, RoutedEventArgs e)
        {
            if (Preview_Img.Source != null)
            {
                if (!FWindows.IsWindowOpen <Window>(Properties.Resources.Preview))
                {
                    Window win = new Window
                    {
                        Title = Properties.Resources.Preview,
                        WindowStartupLocation = WindowStartupLocation.CenterScreen,
                        Width  = Preview_Img.Source.Width,
                        Height = Preview_Img.Source.Height
                    };
                    win.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display);
                    if (Preview_Img.Source.Height > 1000 || Preview_Img.Source.Width > 1800)
                    {
                        win.WindowState = WindowState.Maximized;
                    }

                    DockPanel dockPanel = new DockPanel
                    {
                        HorizontalAlignment = HorizontalAlignment.Center,
                        VerticalAlignment   = VerticalAlignment.Center,
                    };

                    Image img = new Image
                    {
                        UseLayoutRounding = true,
                        Source            = Preview_Img.Source
                    };
                    dockPanel.Children.Add(img);

                    win.Content = dockPanel;
                    win.Show();
                }
                else
                {
                    FWindows.GetOpenedWindow <Window>(Properties.Resources.Preview).Focus();
                }
            }
        }