private void initializeWindows() { var aboutWindowViewModel = new AboutWindowViewModel( updateService: Toggl.UpdateService, versionText: $"Version {Program.Version()} {Utils.Bitness()}"); this.childWindows = new Window[] { this.editPopup = new EditViewPopup(), new AboutWindow(aboutWindowViewModel), new FeedbackWindow(), new PreferencesWindow(), }; this.idleNotificationWindow = new IdleNotificationWindow(); this.editPopup.EditView.SetTimer(this.timerEntryListView.Timer); this.timerEntryListView.Timer.ViewModel.WhenValueChanged(x => x.DurationText).Subscribe(x => updateTaskbarTooltip(this, x)); this.timerEntryListView.Timer.StartStopButtonClicked += () => closeEditPopup(true); this.timerEntryListView.Entries.SetEditPopup(this.editPopup); this.timerEntryListView.Entries.CloseEditPopup += (sender, args) => this.closeEditPopup(true); this.editPopup.IsVisibleChanged += this.editPopupVisibleChanged; this.editPopup.SizeChanged += (sender, args) => this.updateEntriesListWidth(); this.idleNotificationWindow.AddedIdleTimeAsNewEntry += (o, e) => this.ShowOnTop(); this.miniTimer = new MiniTimerWindow(this); this.IsVisibleChanged += this.ownChildWindows; }
private void initializeWindows() { var aboutWindowViewModel = new AboutWindowViewModel( updateService: new UpdateService(Toggl.IsUpdateCheckDisabled(), Toggl.UpdatesPath), versionText: $"Version {Program.Version()} {Utils.Bitness()}"); this.childWindows = new Window[] { this.editPopup = new EditViewPopup(), new AboutWindow(aboutWindowViewModel), new FeedbackWindow(), new PreferencesWindow(), }; this.idleNotificationWindow = new IdleNotificationWindow(); this.editPopup.EditView.SetTimer(this.timerEntryListView.Timer); this.timerEntryListView.Timer.RunningTimeEntrySecondPulse += this.updateTaskbarTooltip; this.timerEntryListView.Timer.StartStopClick += (sender, args) => this.closeEditPopup(true); this.timerEntryListView.Entries.SetEditPopup(this.editPopup); this.timerEntryListView.Entries.CloseEditPopup += (sender, args) => this.closeEditPopup(true); this.editPopup.IsVisibleChanged += this.editPopupVisibleChanged; this.editPopup.SizeChanged += (sender, args) => this.updateEntriesListWidth(); this.idleNotificationWindow.AddedIdleTimeAsNewEntry += (o, e) => this.ShowOnTop(); this.miniTimer = new MiniTimerWindow(this); this.IsVisibleChanged += this.ownChildWindows; }
/// <summary> /// Initializes a new instance of the <see cref="AboutWindow"/> class. /// </summary> public AboutWindow() { InitializeComponent(); _viewModel = new AboutWindowViewModel(); this.DataContext = _viewModel; }
public AboutWindow(AboutWindowViewModel aboutWindowViewModel, ITranslator translator, ViewCustomization customization) { DataContext = aboutWindowViewModel; InitializeComponent(); translator.Translate(this); ApplyCustomization(customization); }
public AboutWindow() { AboutWindowViewModel vm = new AboutWindowViewModel(); this.DataContext = vm; InitializeComponent(); }
/// <summary> /// Initializes a new instance of the <see cref="AboutWindow" /> class. /// </summary> public AboutWindow( ) { InitializeComponent( ); var viewModel = new AboutWindowViewModel( ); DataContext = viewModel; }
public void CreateAboutWindow() { Window view = new AboutWindow(); ViewModelWindowBase viewModel = new AboutWindowViewModel(); view = ApplyWindowAttributes(view, viewModel); view.ShowDialog(); }
public AboutWindow() { InitializeComponent(); AboutWindowViewModel viewModel = new AboutWindowViewModel(); this.DataContext = viewModel; viewModel.Window = this; }
public static void ShowAboutWindow(IApplicationInfo applicationInfo, ImageSource applicationIcon, string eula, string copyright) { AboutWindowViewModel viewModel = new AboutWindowViewModel(applicationInfo, applicationIcon, eula, copyright); AboutWindow window = new AboutWindow { DataContext = viewModel }; window.ShowDialog(); }
public void ViewModel_ShouldProvide_ValidAssemblyDetails() { Assembly assembly = Assembly.GetAssembly(typeof(AboutWindowViewModelTests)); AboutWindowViewModel vm = new AboutWindowViewModel(assembly); vm.Description.ShouldBe("TestDescription"); vm.Company.ShouldBe("TestCompany"); vm.Copyright.ShouldBe("TestCopyright"); vm.Product.ShouldBe("TestProduct"); vm.Title.ShouldBe("TestTitle"); vm.Trademark.ShouldBe("TestTradeMark"); vm.Version.ShouldBe("1.0.0.0"); }
private void setDataContext() { vm = new AboutWindowViewModel(); ImageButtonContext close = new ImageButtonContext(); close.ImageSource = TryFindResource("close") as ImageSource; ImageTextButtonContext ok = new ImageTextButtonContext(); ok.ImageSource = TryFindResource("yes") as ImageSource; vm.close = close; vm.ok = ok; vm.header = new LabeledHeaderContext(); setControlValues(); setLocalization(); this.DataContext = vm; }
public AboutWindow(AboutWindowViewModel viewmodel) { this.DataContext = viewmodel; InitializeComponent(); }
public AboutWindow() { DataContext = new AboutWindowViewModel(); InitializeComponent(); }
public AboutWindow() { InitializeComponent(); ViewModel = new AboutWindowViewModel(this); }
public AboutWindow(AboutWindowViewModel aboutWindowViewModel, ViewCustomization customization) { DataContext = aboutWindowViewModel; InitializeComponent(); ApplyCustomization(customization); }