private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { _main = new Main(); _settings = new Settings(); _game = new Game(); _gameParams = new GameParams(); _main.GameParams = _gameParams; _main.Settings = _settings; _main.NewGameClick += ChangePage; _main.SettingsClick += ChangePage; _main.ExitClick += ExitClick; _settings.Main = _main; _settings.BackClick += ChangePage; _game.Main = _main; _game.ExitClick += ChangePage; _gameParams.Game = _game; _gameParams.Main = _main; _gameParams.ExitClick += ChangePage; _gameParams.StartClick += ChangePage; FMain.Navigate(_main); }
private void ChangePage(object sender, MyArgs myArgs) => FMain.Navigate(myArgs.IsUri ? myArgs.Uri : myArgs.Root);