Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Create a new class</p> <pre><code>public class SettingsFlyout { private const int _width = 346; private Popup _popup; /// &lt;summary&gt; /// Show the Flyout with the UserControl as content /// &lt;/summary&gt; /// &lt;param name="control"&gt;&lt;/param&gt; public void ShowFlyout(UserControl control) { _popup = new Popup(); _popup.Closed += OnPopupClosed; Window.Current.Activated += OnWindowActivated; _popup.IsLightDismissEnabled = true; _popup.Width = _width; _popup.Height = Window.Current.Bounds.Height; control.Width = _width; control.Height = Window.Current.Bounds.Height; _popup.Child = control; _popup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - _width); _popup.SetValue(Canvas.TopProperty, 0); _popup.IsOpen = true; } private void OnWindowActivated(object sender, Windows.UI.Core.WindowActivatedEventArgs e) { if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated) { _popup.IsOpen = false; } } void OnPopupClosed(object sender, object e) { Window.Current.Activated -= OnWindowActivated; } } </code></pre> <p>In a XAML page take a button and then write the button click event.</p> <pre><code>private void Button_Click_1(object sender, RoutedEventArgs e) { SettingsFlyout flyout = new SettingsFlyout(); flyout.ShowFlyout(new FlyoutContentUserControl()); } </code></pre> <p>Please note one thing <code>FlyoutContentUserControl</code> is the user control which you would like to show.</p> <p>Credits goes to <a href="https://github.com/Q42/Q42.WinRT" rel="nofollow">Q42.WinRT</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload