示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HoverPopup"/> class and sets up its child UI elements.
        /// </summary>
        /// <param name="hoverObject">The hover object.</param>
        /// <param name="artifactViewer">The artifact viewer.</param>
        internal HoverPopup(HoverObject hoverObject, ArtifactViewer artifactViewer)
        {
            this.hoverObject = hoverObject;
            this.artifactViewer = artifactViewer;

            this.StaysOpen = false;
            this.AllowsTransparency = true;
            this.Placement = PlacementMode.Mouse;
            this.PopupAnimation = PopupAnimation.Fade;
            this.MaxWidth = 300;
            this.MouseMove += this.HoverPopupMouseMove;

            this.awayTimer = new DispatcherTimer();
            this.awayTimer.Interval = TimeSpan.FromMilliseconds(50);
            this.awayTimer.Tick += this.AwayTimerTick;

            this.layoutGrid = new Grid();
            this.layoutGrid.Margin = new Thickness(0, 0, 8, 8);
            this.Child = this.layoutGrid;

            DropShadowBitmapEffect dropShadowEffect = new DropShadowBitmapEffect();
            dropShadowEffect.ShadowDepth = 5;
            this.layoutGrid.BitmapEffect = dropShadowEffect;

            Border border = new Border();
            border.Background = Brushes.White;
            border.Padding = new Thickness(5);
            border.CornerRadius = new CornerRadius(5);
            this.layoutGrid.Children.Add(border);

            this.layoutStackPanel = new StackPanel();
            border.Child = this.layoutStackPanel;

            this.AddTitle();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HoverPopup"/> class and sets up its child UI elements.
        /// </summary>
        /// <param name="hoverObject">The hover object.</param>
        /// <param name="artifactViewer">The artifact viewer.</param>
        internal HoverPopup(HoverObject hoverObject, ArtifactViewer artifactViewer)
        {
            this.hoverObject    = hoverObject;
            this.artifactViewer = artifactViewer;

            this.StaysOpen          = false;
            this.AllowsTransparency = true;
            this.Placement          = PlacementMode.Mouse;
            this.PopupAnimation     = PopupAnimation.Fade;
            this.MaxWidth           = 300;
            this.MouseMove         += this.HoverPopupMouseMove;

            this.awayTimer          = new DispatcherTimer();
            this.awayTimer.Interval = TimeSpan.FromMilliseconds(50);
            this.awayTimer.Tick    += this.AwayTimerTick;

            this.layoutGrid        = new Grid();
            this.layoutGrid.Margin = new Thickness(0, 0, 8, 8);
            this.Child             = this.layoutGrid;

            DropShadowBitmapEffect dropShadowEffect = new DropShadowBitmapEffect();

            dropShadowEffect.ShadowDepth = 5;
            this.layoutGrid.BitmapEffect = dropShadowEffect;

            Border border = new Border();

            border.Background   = Brushes.White;
            border.Padding      = new Thickness(5);
            border.CornerRadius = new CornerRadius(5);
            this.layoutGrid.Children.Add(border);

            this.layoutStackPanel = new StackPanel();
            border.Child          = this.layoutStackPanel;

            this.AddTitle();
        }