Beispiel #1
0
        public void HideMainMenu()
        {
            MainMenuUserControl mainMenu = (MainMenuUserControl)RootCanvas.Children.Cast <FrameworkElement>().FirstOrDefault(o => o.Name == "MainMenu");

            if (mainMenu != null)
            {
                mainMenu.Visibility = Visibility.Hidden;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Permet d'afficher le menu principal
        /// </summary>
        public void ShowMainMenu()
        {
            MainMenuUserControl mainMenuUserControl = (MainMenuUserControl)RootCanvas.Children.Cast <FrameworkElement>().FirstOrDefault(o => o.Name == "MainMenu");

            if (mainMenuUserControl == null)
            {
                mainMenuUserControl        = new MainMenuUserControl();
                mainMenuUserControl.Name   = "MainMenu";
                mainMenuUserControl.Width  = RootCanvas.ActualWidth;
                mainMenuUserControl.Height = RootCanvas.ActualHeight;
                RootCanvas.Children.Add(mainMenuUserControl);
                Canvas.SetLeft(mainMenuUserControl, 0);
                Canvas.SetTop(mainMenuUserControl, 0);
            }

            HideBoardGame();

            mainMenuUserControl.Visibility = Visibility.Visible;
        }
Beispiel #3
0
        public MainForm(
            [NotNull] IConsoleArgs consoleArgs,
            [NotNull] CombinedLogsUserControl combinedLogsUserControl,
            [NotNull] MainMenuUserControl mainMenuUserControl,
            [NotNull] IFeaturesManager featuresManager,
            [NotNull] INewsViewModelFactory newsViewModelFactory,
            [NotNull] ITelemetry telemetry)
        {
            if (consoleArgs == null)
            {
                throw new ArgumentNullException(nameof(consoleArgs));
            }
            if (combinedLogsUserControl == null)
            {
                throw new ArgumentNullException(nameof(combinedLogsUserControl));
            }
            if (mainMenuUserControl == null)
            {
                throw new ArgumentNullException(nameof(mainMenuUserControl));
            }
            if (featuresManager == null)
            {
                throw new ArgumentNullException(nameof(featuresManager));
            }
            if (newsViewModelFactory == null)
            {
                throw new ArgumentNullException(nameof(newsViewModelFactory));
            }
            if (telemetry == null)
            {
                throw new ArgumentNullException(nameof(telemetry));
            }
            this.combinedLogsUserControl = combinedLogsUserControl;
            this.mainMenuUserControl     = mainMenuUserControl;
            this.featuresManager         = featuresManager;
            this.telemetry = telemetry;

            InitializeComponent();
        }