Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-4339 Popup aligment right-handed #12491

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/DynamoCoreWpf/Views/GuidedTour/PopupWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
Expand All @@ -19,6 +20,8 @@ public partial class PopupWindow : Popup
private bool isClosingTour;

private const string packagesTourName = "packages";
//Field that indicates wheter popups are left-aligned or right-aligned
private const string menuDropAligment = "_menuDropAlignment";

internal WebBrowserWindow webBrowserWindow;

Expand Down Expand Up @@ -55,7 +58,19 @@ public PopupWindow(PopupWindowViewModel viewModel, HostControlInfo hInfo)
Opened += PopupWindow_Opened;
Closed += PopupWindow_Closed;

isClosingTour = false;
isClosingTour = false;

EnsureStandardPopupAlignment();
}

private void EnsureStandardPopupAlignment()
{
var menuDropAlignmentField = typeof(SystemParameters).GetField(menuDropAligment, BindingFlags.NonPublic | BindingFlags.Static);
if (SystemParameters.MenuDropAlignment && menuDropAlignmentField != null)
{
//Sets field to false and ignores the alignment
menuDropAlignmentField.SetValue(null, false);
}
}

private void PopupWindow_Closed(object sender, EventArgs e)
Expand Down