public MiniTimerWindow(MainWindow mainWindow)
        {
            this.contextMenu = mainWindow.ContextMenu;
            this.InitializeComponent();
            this.WindowStyle = WindowStyle.SingleBorderWindow;

            this.interopHelper = new WindowInteropHelper(this);

            KeyboardShortcuts.RegisterShortcuts(this);
        }
Exemple #2
0
        public EditViewPopup()
        {
            this.InitializeComponent();

            this.MinWidth       = this.EditView.MinWidth + 16;
            this.mainGrid.Width = 0;

            Toggl.OnTimeEntryEditor += this.onTimeEntryEditor;

            KeyboardShortcuts.RegisterShortcuts(this);
        }
        public MiniTimerWindow(MainWindow mainWindow)
        {
            this.contextMenu = mainWindow.cogButton.ContextMenu;
            this.InitializeComponent();
            this.Closing += OnClosing;
            var sizeChangedObservable = Observable.FromEventPattern <SizeChangedEventHandler, SizeChangedEventArgs>(
                handler => this.SizeChanged += handler,
                handler => this.SizeChanged -= handler);

            sizeChangedObservable
            .Where(x => x.EventArgs.WidthChanged)
            .Throttle(TimeSpan.FromMilliseconds(500))
            .ObserveOnDispatcher()
            .Subscribe(x => ((Window)x.Sender).SizeToContent = SizeToContent.Height);

            this.timer.MouseCaptured += OnMouseCaptured;

            KeyboardShortcuts.RegisterShortcuts(this);
        }