コード例 #1
0
ファイル: GoldFieldViewModel.cs プロジェクト: Edrenn/Clickers
        public GoldFieldViewModel(GoldFieldView view)
        {
            this.view = view;
            EventGenerator();
            view.DataContext = GameViewModel.Instance;

            foreach (RessourceProducer item in GameViewModel.Instance.MainCastle.GoldProducers)
            {
                GoldProducerViewModel controller = new GoldProducerViewModel(item);
                if (item.IsVisible)
                {
                    if (item.IsActive == true)
                    {
                        controller.SetActiveView();
                        this.view.AllGoldProducersSP.Children.Add(controller.View);
                    }
                    else
                    {
                        this.view.AllGoldProducersSP.Children.Add(controller.View);
                    }
                }
                else
                {
                    controller.View.Visibility = System.Windows.Visibility.Collapsed;
                    this.view.AllGoldProducersSP.Children.Add(controller.View);
                }
            }
        }
コード例 #2
0
 public GoldFieldViewModel()
 {
     this.view = new GoldFieldView();
     EventGenerator();
     view.DataContext = GameViewModel.Instance;
 }
コード例 #3
0
        private void GoldFieldButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            GoldFieldView newGoldFieldView = new GoldFieldView();

            Switcher.Switch(newGoldFieldView);
        }