/// <summary> /// Closes the identified flyout, passing the provided flyoutparameters to the flyout's CanClose method. /// If forceClose is true, the flyout will be closed even if CanClose returns false. The result of CanClose /// will be returned by this method even if closure is forced. /// </summary> /// <param name="key">Identifies the flyout to close.</param> /// <param name="flyoutParameters">Passed to the flyouts CanClose method, and indirectly to OnClosing.</param> /// <param name="forceClose">Force flyout closure even if CanClose returns false.</param> /// <returns>The results of the indentified flyouts CanClose method.</returns> public bool CloseFlyout(string key, FlyoutParameters flyoutParameters, bool forceClose) { var flyoutToClose = flyouts[key]; bool canClose = flyoutToClose.CanClose(flyoutParameters); if (!forceClose && !canClose) { return(false); } flyoutToClose.Open(flyoutParameters); return(canClose); }
/// <summary> /// Attempts to open the identified flyout /// The specified flyoutparameters are passed to the flyout's CanOpen method and the result returned, /// but if forceOpen is true, the flyout is opened even if CanOpen returns false. /// </summary> /// <param name="key">Identifies the flyout to open.</param> /// <param name="flyoutParameters">Passed to the flyouts CanOpen method, and indirectly to OnOpening.</param> /// <param name="forceOpen">Whether to force open the flyout.</param> /// <returns>The result of the identified flyout's CanOpen method.</returns> public bool OpenFlyout(string key, FlyoutParameters flyoutParameters, bool forceOpen) { var flyoutToActivate = flyouts[key]; bool canOpen = flyoutToActivate.CanOpen(flyoutParameters); if (!forceOpen && !canOpen) { return(false); } flyoutToActivate.Open(flyoutParameters); return(canOpen); }
/// <summary> /// Open the flyout. /// </summary> /// <param name="flyoutParameters"></param> public void Open(FlyoutParameters flyoutParameters) { OnOpening(flyoutParameters); IsOpen = true; }
/// <summary> /// Close the flyout. /// </summary> /// <param name="flyoutParameters"></param> public void Close(FlyoutParameters flyoutParameters) { OnClosing(flyoutParameters); IsOpen = false; }
/// <summary> /// Event delegate called on flyout closing, with FlyoutEventArgs. /// </summary> /// <param name="flyoutParameters">Instance of <typeparamref name="FlyoutParameters"/> containing information on current Close request.</param> protected virtual void OnOpening(FlyoutParameters flyoutParameters) { }
/// <summary> /// Event delegate called on flyout closing with FlyoutEventArgs. /// </summary> /// <param name="flyoutParameters">Instance of <typeparamref name="FlyoutParameters"/> containing information on current Close request.</param> protected virtual void OnClosing(FlyoutParameters flyoutParameters) { }
/// <summary> /// Whether the flyout is currently able to close. /// Default: returns true. /// Override in concrete child class to implement custom logic. /// </summary> /// <param name="flyoutParameters">Instance of <typeparamref name="FlyoutParameters"/> containing information on current Close request.</param> /// <returns>True if flyout can close, false if not.</returns> public virtual bool CanClose(FlyoutParameters flyoutParameters) { return(true); }
/// <summary> /// Attempt to close the identified flyout, passing the provided flyoutparameters to the flyout's CanClose method. /// </summary> /// <param name="key">Identifies the flyout to close.</param> /// <param name="flyoutParameters">Passed to the flyouts CanClose method, and indirectly to OnClosing.</param> /// <returns>True if closed, false if CanClose prevented closing.</returns> public bool CloseFlyout(string key, FlyoutParameters flyoutParameters) { return(CloseFlyout(key, flyoutParameters, false)); }
/// <summary> /// Attempt to open the identified flyout, passing the specified flyoutparameters to the flyout's CanOpen method. /// </summary> /// <param name="key">Identifies the flyout to open.</param> /// <param name="flyoutParameters">Passed to the flyouts CanOpen method, and indirectly to OnOpening.</param> /// <returns>True if opened, false if CanOpen prevented opening.</returns> public bool OpenFlyout(string key, FlyoutParameters flyoutParameters) { return(OpenFlyout(key, flyoutParameters, false)); }