Пример #1
0
        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;
        }
Пример #2
0
        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;
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AboutWindow"/> class.
        /// </summary>
        public AboutWindow()
        {
            InitializeComponent();

            _viewModel       = new AboutWindowViewModel();
            this.DataContext = _viewModel;
        }
Пример #4
0
 public AboutWindow(AboutWindowViewModel aboutWindowViewModel, ITranslator translator, ViewCustomization customization)
 {
     DataContext = aboutWindowViewModel;
     InitializeComponent();
     translator.Translate(this);
     ApplyCustomization(customization);
 }
Пример #5
0
        public AboutWindow()
        {
            AboutWindowViewModel vm = new AboutWindowViewModel();

            this.DataContext = vm;
            InitializeComponent();
        }
Пример #6
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="AboutWindow" /> class.
        /// </summary>
        public AboutWindow( )
        {
            InitializeComponent( );

            var viewModel = new AboutWindowViewModel( );

            DataContext = viewModel;
        }
Пример #7
0
        public void CreateAboutWindow()
        {
            Window view = new AboutWindow();
            ViewModelWindowBase viewModel = new AboutWindowViewModel();

            view = ApplyWindowAttributes(view, viewModel);
            view.ShowDialog();
        }
Пример #8
0
        public AboutWindow()
        {
            InitializeComponent();
            AboutWindowViewModel viewModel = new AboutWindowViewModel();

            this.DataContext = viewModel;
            viewModel.Window = this;
        }
Пример #9
0
        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();
        }
Пример #10
0
        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");
        }
Пример #11
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;
        }
Пример #12
0
 public AboutWindow(AboutWindowViewModel viewmodel)
 {
     this.DataContext = viewmodel;
     InitializeComponent();
 }
Пример #13
0
 public AboutWindow()
 {
     DataContext = new AboutWindowViewModel();
     InitializeComponent();
 }
 public AboutWindow()
 {
     InitializeComponent();
     ViewModel = new AboutWindowViewModel(this);
 }
Пример #15
0
 public AboutWindow(AboutWindowViewModel aboutWindowViewModel, ViewCustomization customization)
 {
     DataContext = aboutWindowViewModel;
     InitializeComponent();
     ApplyCustomization(customization);
 }