Ejemplo n.º 1
0
 public void ClosePreview()
 {
     if (PreviewPane != null)
     {
         PreviewPane.FastClose();
     }
 }
Ejemplo n.º 2
0
        private void ShowPopup()
        {
            if (tip != null && tip.IsOpen)
            {
                tip.FastClose();
            }

            tip       = new BalloonTip(this);
            tip.Style = BalloonTipStyle;
            tip.Owner = Window.GetWindow(this);

            tip.SetBinding(Window.ContentProperty, new Binding()
            {
                Source = this,
                Path   = new PropertyPath(QuoteProperty)
            });

            tip.Closed += (sender, e) =>
            {
                IsChecked = false;
                tip       = null;
            };

            tip.FastShow();
        }
Ejemplo n.º 3
0
        private static void OpenContactExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            PeoplePeek content = sender as PeoplePeek;

            BalloonTip tip = Window.GetWindow(content) as BalloonTip;

            tip.FastClose();
        }
Ejemplo n.º 4
0
        private static void NewNoteExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            NotesPeek content = sender as NotesPeek;

            BalloonTip tip = Window.GetWindow(content) as BalloonTip;

            tip.FastClose();
        }
Ejemplo n.º 5
0
        private static void OpenAppointmentExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            //if (OpenAppointmentCommand != null)
            //{
            //	OpenAppointmentCommand.Execute(e.Parameter, Application.Current.MainWindow);

            CalendarPeek content = sender as CalendarPeek;

            BalloonTip tip = Window.GetWindow(content) as BalloonTip;

            tip.FastClose();
            //}
        }
Ejemplo n.º 6
0
        private static void ExecutedDockPeekCommand(object sender, ExecutedRoutedEventArgs e)
        {
            UndockedPeek peek = sender as UndockedPeek;

            BalloonTip tip = peek.Parent as BalloonTip;

            MainWindow mainWindow;

            if (tip != null)
            {
                tip.FastClose();
                mainWindow = tip.Owner as MainWindow;
            }
            else
            {
                mainWindow = (MainWindow)Application.Current.MainWindow;
            }

            UIElement content = peek.PeekContent();

            if (content == null)
            {
                throw new NotImplementedException("");
            }

            foreach (DockedPeek each in mainWindow.dockedPeeks.Items)
            {
                if (each.Content.ToString() == content.ToString())
                {
                    return;
                }
            }

            DockedPeek docked = new DockedPeek();

            docked.Content = content;

            mainWindow.dockedPeeks.Items.Add(docked);
            mainWindow.SwitchToNormalMode();
        }
Ejemplo n.º 7
0
        private void InitializePreviewPane()
        {
            if (PreviewPane == null || !PreviewPane.IsOpen)
            {
                if (OpenPreviewPane != null && OpenPreviewPane.IsOpen)
                {
                    OpenPreviewPane.FastClose();
                }

                if (PreviewPane != null)
                {
                    PreviewPane.Content = null;
                }

                PreviewPane = new BalloonTip(this);

                PreviewPane.Offset        = PreviewPaneOffset;
                PreviewPane.Closed       += PreviewPane_Closed;
                PreviewPane.PositionOrder = PreviewPanePositionOrder;
                PreviewPane.ContentWidth  = 250;
                PreviewPane.ContentHeight = 330;
                PreviewPane.Owner         = Window.GetWindow(this);

                if (AssociatedControl == null)
                {
                    AssociatedControl = AssociatedControlType.GetConstructor(new Type[0]).Invoke(null);
                }

                PreviewPane.Content = AssociatedControl;
                PreviewPane.Show();

                OpenPreviewPane = PreviewPane;
            }
            else
            {
                PreviewPane.ResetTimer();
            }
        }