Exemple #1
0
        public void PreviewSnip(Snip toPreview)
        {
            if (toPreview is null)
            {
                return;
            }

            _selectedSnip = toPreview;

            if (_readyToExport)
            {
                Cursor         = Cursors.Wait;
                _readyToExport = false;
                return;
            }

            Clipboard.SetDataObject(toPreview.BitmapImageScreenshot);
            var previewWindow = new PreviewWindow(toPreview)
            {
                Owner        = GetWindow(this),
                WindowClosed = window => _previews.Remove(window)
            };

            _previews.Add(previewWindow);
            previewWindow.Show();
        }
Exemple #2
0
        private void ToggleDecoration(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton != MouseButton.Left)
            {
                return;
            }

            var newLeft = _showingDecoration
                ? Left - LeftBorderWidth
                : Left + LeftBorderWidth;
            var newTop = _showingDecoration
                ? Top + TitleBarHeight
                : Top - TitleBarHeight;
            var newWindow =
                new PreviewWindow(_toPreview, newLeft, newTop, !_showingDecoration)
            {
                WindowClosed = WindowClosed
            };

            newWindow.Show();
            Close();
        }