コード例 #1
0
        private void Undo_Button_Click(object sender, RoutedEventArgs e)
        {
            Button           btn = sender as Button;
            OthelloView      v   = btn.DataContext as OthelloView;
            OthelloViewModel vm  = v.FindResource("vm") as OthelloViewModel;

            vm.UndoLastMove();
        }
コード例 #2
0
ファイル: MainWindow.g.i.cs プロジェクト: akariin/CECS475
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 16 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Undo_Click);

            #line default
            #line hidden
                return;

            case 2:
                this.OthelloView = ((Cecs475.Othello.Application.OthelloView)(target));
                return;
            }
            this._contentLoaded = true;
        }
コード例 #3
0
        private void UndoButton_Click(object sender, RoutedEventArgs e)
        {
            var viewModel = OthelloView.FindResource("vm") as OthelloViewModel;

            viewModel.UndoLastMove();
        }