/
MainShellView.xaml.cs
46 lines (38 loc) · 1.29 KB
/
MainShellView.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.ComponentModel;
using System.Reflection;
using System.Windows;
using FreePIE.GUI.Common.AvalonDock;
using Xceed.Wpf.AvalonDock;
namespace FreePIE.GUI.Shells
{
/// <summary>
/// Interaction logic for MainShell.xaml
/// </summary>
public partial class MainShellView : IDockingManagerSource
{
private static readonly FieldInfo MenuDropAlignmentField;
static MainShellView()
{
MenuDropAlignmentField = typeof (SystemParameters).GetField("_menuDropAlignment",
BindingFlags.NonPublic | BindingFlags.Static);
System.Diagnostics.Debug.Assert(MenuDropAlignmentField != null);
EnsureStandardPopupAlignment();
SystemParameters.StaticPropertyChanged += (s, e) => EnsureStandardPopupAlignment();
}
private static void EnsureStandardPopupAlignment()
{
if (SystemParameters.MenuDropAlignment && MenuDropAlignmentField != null)
{
MenuDropAlignmentField.SetValue(null, false);
}
}
public MainShellView()
{
InitializeComponent();
}
public DockingManager DockingManager
{
get { return Manager; }
}
}
}