public void DebugPageViewModel_UICommands()
        {
            var unconfiguredProject = UnconfiguredProjectFactory.Create(filePath: @"C:\Foo\foo.proj");
            var viewModel           = new DebugPageViewModel(null, unconfiguredProject);

            Assert.IsType <Utilities.DelegateCommand>(viewModel.BrowseDirectoryCommand);
            Assert.IsType <Utilities.DelegateCommand>(viewModel.BrowseExecutableCommand);
            Assert.IsType <Utilities.DelegateCommand>(viewModel.NewProfileCommand);
            Assert.IsType <Utilities.DelegateCommand>(viewModel.DeleteProfileCommand);
        }
Exemplo n.º 2
0
        void DebugPageControlControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (e.OldValue != null && e.OldValue is DebugPageViewModel)
            {
                DebugPageViewModel viewModel = e.OldValue as DebugPageViewModel;
                viewModel.FocusEnvironmentVariablesGridRow   -= OnFocusEnvironmentVariableGridRow;
                viewModel.ClearEnvironmentVariablesGridError -= OnClearEnvironmentVariableGridError;
            }

            if (e.NewValue != null && e.NewValue is DebugPageViewModel)
            {
                DebugPageViewModel viewModel = e.NewValue as DebugPageViewModel;
                viewModel.FocusEnvironmentVariablesGridRow   += OnFocusEnvironmentVariableGridRow;
                viewModel.ClearEnvironmentVariablesGridError += OnClearEnvironmentVariableGridError;
            }
        }