From: sr55 Date: Sun, 11 May 2014 12:18:47 +0000 (+0000) Subject: WinGui: Cosmetic improvement to the SplitButton Control. It no longer appears for... X-Git-Tag: 0.10.0~351 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04cf20ef75e90d40d0d67487fa79e77f375c8482;p=handbrake WinGui: Cosmetic improvement to the SplitButton Control. It no longer appears for a split second when the control initialises. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6180 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs b/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs index 46e662620..eb8b5df0a 100644 --- a/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs +++ b/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs @@ -128,6 +128,7 @@ namespace HandBrakeWPF.Controls.SplitButton if (this.contextMenu != null) { // Add the ContextMenu as a logical child (for DataContext and RoutedCommands) + this.contextMenu.Visibility = Visibility.Collapsed; this.contextMenu.IsOpen = true; DependencyObject current = this.contextMenu; do @@ -137,11 +138,11 @@ namespace HandBrakeWPF.Controls.SplitButton } while (null != current); - this.contextMenu.IsOpen = false; + this.contextMenu.IsOpen = false; this.AddLogicalChild(this.logicalChild); this.contextMenu.Opened += this.ContextMenu_Opened; - this.contextMenu.Closed += this.ContextMenu_Closed; + this.contextMenu.Closed += this.ContextMenu_Closed; } } } @@ -197,6 +198,7 @@ namespace HandBrakeWPF.Controls.SplitButton { this.contextMenu.HorizontalOffset = 0; this.contextMenu.VerticalOffset = 0; + this.contextMenu.Visibility = Visibility.Visible; this.contextMenu.IsOpen = true; } }