상속: SelectableItem, IAsyncUiProxy
예제 #1
0
        private void _constructPlayerCurrentPrivateDeck(PlayerViewModel model)
        {
            if (model.CurrentPrivateDeck != null)
            {
                Trace.Assert(model.CurrentPrivateDeck.Cards != null);
                if (_privateDeckChoiceWindow != null)
                {
                    gridRoot.Children.Remove(_privateDeckChoiceWindow);
                }

                _privateDeckChoiceWindow = new ChildWindow();
                _privateDeckChoiceWindow.Template = Resources["DarkGreenWindowStyle"] as ControlTemplate;
                _privateDeckChoiceWindow.MaxWidth = 800;
                _privateDeckChoiceWindow.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center;
                _privateDeckChoiceWindow.CloseButtonVisibility = Visibility.Collapsed;
                _privateDeckChoiceWindow.Effect = new DropShadowEffect() { BlurRadius = 10d };
                _privateDeckChoiceWindow.WindowStartupLocation = Xceed.Wpf.Toolkit.WindowStartupLocation.Center;
                string title = PromptFormatter.Format(new CardChoicePrompt("PrivateDeck", model.Player, model.CurrentPrivateDeck.TraslatedName));
                _privateDeckChoiceWindow.Caption = title;

                var box = new PrivateDeckBox();
                box.DataContext = model.CurrentPrivateDeck.Cards;
                _privateDeckChoiceWindow.Content = box;

                gridRoot.Children.Add(_privateDeckChoiceWindow);
                _privateDeckChoiceWindow.Show();
            }
            else
            {
                gridRoot.Children.Remove(_privateDeckChoiceWindow);
                _privateDeckChoiceWindow = null;
            }
        }
예제 #2
0
        private void _constructPlayerCurrentSpecialDeck(PlayerViewModel model)
        {
            if (model.CurrentSpecialDeck != null)
            {
                Trace.Assert(model.CurrentSpecialDeck.Cards != null);
                if (_privateDeckChoiceWindow != null)
                {
                    gridRoot.Children.Remove(_privateDeckChoiceWindow);
                }

                _privateDeckChoiceWindow = new ChildWindow();
                _privateDeckChoiceWindow.Template = Resources["BlackWindowStyle"] as ControlTemplate;
                _privateDeckChoiceWindow.MaxWidth = 800;
                _privateDeckChoiceWindow.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center;
                _privateDeckChoiceWindow.CloseButtonVisibility = Visibility.Collapsed;
                _privateDeckChoiceWindow.WindowStartupLocation = Xceed.Wpf.Toolkit.WindowStartupLocation.Center;
                string title = LogFormatter.Translate(new CardChoicePrompt("SpecialDeck", model.CurrentSpecialDeck.DeckPlace));
                _privateDeckChoiceWindow.Caption = title;

                var box = new PrivateDeckBox();
                box.DataContext = model.CurrentSpecialDeck.Cards;
                _privateDeckChoiceWindow.Content = box;

                gridRoot.Children.Add(_privateDeckChoiceWindow);
                _privateDeckChoiceWindow.Show();
            }
            else
            {
                gridRoot.Children.Remove(_privateDeckChoiceWindow);
                _privateDeckChoiceWindow = null;
            }
        }