示例#1
0
        private void SetUpGameDialog()
        {
            AddGameDialogViewModel = new AddGameDialogViewModel();

            AddGameDialogViewModel.OnItemAdded += (s, e) =>
            {
                if (((DialogRoutedEventArgs)e).Object != null)
                {
                    AddGame((VideoGame)(((DialogRoutedEventArgs)e).Object));
                }
            };

            OnGameDialogSetUp?.Invoke(this, new RoutedEventArgs());
        }
示例#2
0
        private void EditGame(VideoGame game)
        {
            AddGameDialogViewModel                  = new AddGameDialogViewModel();
            AddGameDialogViewModel.Item             = game;
            AddGameDialogViewModel.EditMode         = true;
            AddGameDialogViewModel.Title            = game.Title;
            AddGameDialogViewModel.GameLocation     = game.GameLocation;
            AddGameDialogViewModel.ImageLocation    = game.ImageLocation;
            AddGameDialogViewModel.TargetParameters = game.TargetParameters;
            AddGameDialogViewModel.EdgeColor        = game.EdgeColor;
            AddGameDialogViewModel.MiddleColor      = game.MiddleColor;
            AddGameDialogViewModel.HighlightColor   = game.HighlightColor;
            AddGameDialogViewModel.ContextMenuMap   = game.ContextMenuMap;

            OnGameEdit?.Invoke(this, new RoutedEventArgs());
        }