public ProjectFileActivityView(ProjectFileActivityViewModel viewModel)
        {
            InitializeComponent();

            _viewModel = viewModel;
            Loaded    += ProjectFileActivityView_Loaded;
        }
Exemplo n.º 2
0
        public void Constructor_AssignProjectFileActivityModels_ReturnsEqual()
        {
            // arrange
            var defaultTestProjectData = _testDataUtil.GetDefaultTestProjectData();
            var projectFileActivities  = defaultTestProjectData[1].ProjectFiles[1].ProjectFileActivities;

            // act
            var model = new ProjectFileActivityViewModel(projectFileActivities);

            // assert
            Assert.Equal(projectFileActivities.Count, model.ProjectFileActivities.Count);
        }
Exemplo n.º 3
0
        public void Constructor_AssignSelectedProjectFileActivityModels_ReturnsSame()
        {
            // arrange
            var defaultTestProjectData = _testDataUtil.GetDefaultTestProjectData();
            var projectFileActivities  = defaultTestProjectData[1].ProjectFiles[1].ProjectFileActivities;

            // act
            var model = new ProjectFileActivityViewModel(projectFileActivities);

            // assert
            // the first item in the collection is selected by default
            Assert.Same(projectFileActivities[0], model.SelectedProjectFileActivity);
        }
Exemplo n.º 4
0
 public ProjectFileActivityViewControl(ProjectFileActivityViewModel viewModel)
 {
     InitializeComponent();
     UpdateViewModel(viewModel);
 }
Exemplo n.º 5
0
 private void AssignView(ProjectFileActivityViewModel viewModel)
 {
     elementHost.Child = new ProjectFileActivityView(viewModel);
 }
Exemplo n.º 6
0
 internal void UpdateViewModel(ProjectFileActivityViewModel viewModel)
 {
     DisposeViewModel();
     AssignView(viewModel);
 }