Ejemplo n.º 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var viewModel = this.DataContext as ChangeListViewModel;

            // If viewModel is not null it means that the user navigated back to this page and the viewModel is already loaded.
            if (viewModel == null)
            {
                var changesetId = string.Empty;

                if (this.NavigationContext.QueryString.TryGetValue("changesetId", out changesetId))
                {
                    viewModel = new ChangeListViewModel(string.Format(CultureInfo.InvariantCulture, "Changesets({0})", changesetId));
                }
                else
                {
                    viewModel = new ChangeListViewModel();
                }

                if (this.State.ContainsKey("CurrentPageNumber"))
                {
                    viewModel.PageNumber = (int)this.State["CurrentPageNumber"];
                }

                if (this.State.ContainsKey("CurrentQuery"))
                {
                    viewModel.Query = (string)this.State["CurrentQuery"];
                }

                viewModel.LoadData();

                this.DataContext = viewModel;
            }
        }
Ejemplo n.º 2
0
 public ChangeBrowserViewModel()
 {
     ButtonBarViewModel      = new ButtonBarViewModel(this);
     ChangeListViewModel     = new ChangeListViewModel(this, new ChangeRepository());
     ChangeDetailsViewModel  = new ChangeDetailsViewModel(new GitService(), VisualStudioWorkspaceService.Instance);
     GerritSettingsViewModel = new GerritSettingsViewModel();
 }
Ejemplo n.º 3
0
 public frmPrjBoqChange(string projectNo, string projectName)
 {
     InitializeComponent();
     this.projectNo   = projectNo;
     this.projectName = projectName;
     viewModel        = new ChangeListViewModel(projectNo, projectName);
     viewModel.Load();
     gcChange.DataSource = viewModel.ChangedList;
     RefreshBottomBar();
 }