public Window InitializeSilent() { var window = ViewService.Instance.TryGet <System.Windows.Window>(this); if (window != null) { window.StateChanged += (o, a) => WindowOnStateChanged(window, a); window.Closing += (o, a) => WindowOnClosing(window, a); ConfigStorage.Instance.ViewConfig.UpdateWindowState(window); } model = new MainPageModel(); UpdateAll = new UpdateAllCommand(model.Library); model.Library.LibraryChanged += LibraryOnLibraryChanged; model.Library.PropertyChanged += LibraryOnPropertyChanged; if (window != null) { TaskbarIcon = new TaskbarIconModel(window.FindName("TaskbarIcon"), model.Library); } model.Show(); Client.ClientOnClientBeenClosed(this, EventArgs.Empty); return(window); }
public UpdatesViewModel(IPackageSourceSelector packageSource, IInstallService installService, ISearchService searchService, SelfPackageConfiguration selfPackageConfiguration, ISelfUpdateService selfUpdate, IComparer <IPackageIdentity> packageVersionComparer) { Ensure.NotNull(installService, "service"); Ensure.NotNull(searchService, "searchService"); Packages = new ObservableCollection <PackageUpdateViewModel>(); Refresh = new RefreshUpdatesCommand(this, packageSource, installService, searchService, selfPackageConfiguration, packageVersionComparer); Update = new UpdateCommand(installService, selfUpdate); UpdateAll = new UpdateAllCommand(this); }
private void OnProjectChanged() { if (myProjectHost.Project == null) { return; } Entries.Clear(); var ctx = myProjectHost.Project.GetAssetsContext(); foreach (var stock in ctx.Stocks) { Entries.Add(new TickerEntry(stock)); } UpdateAllCommand.RaiseCanExecuteChanged(); }