private void OnLoaded(object sender, RoutedEventArgs e)
{
Window.Current.Activated += OnCurrentWindowActivated;
// in RTL languages on the OS, the SettingsPane comes from the left edge
if (SettingsPane.Edge == SettingsEdgeLocation.Left)
{
if (_rootBorder != null) _rootBorder.BorderThickness = new Thickness(0, 0, 1, 0);
}
_settingsWidth = (double)this.FlyoutWidth;
// setting all the widths to be the size of flyout
_hostPopup.Width = this.Width = _contentScrollViewer.Width = _settingsWidth;
// ensure it comes from the correct edge location
_hostPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (_windowBounds.Width - _settingsWidth) : 0);
// handling the case where it isn't parented to the visual tree
// inspect the visual root and adjust.
if (_hostPopup.Parent == null)
{
Windows.UI.ViewManagement.InputPane.GetForCurrentView().Showing += OnInputPaneShowing;
Windows.UI.ViewManagement.InputPane.GetForCurrentView().Hiding += OnInputPaneHiding;
}
}