}
/// <summary>
- /// Occurs when the hardware Back button is pressed.
- /// </summary>
- public event EventHandler BackButtonPressed;
-
- /// <summary>
/// Occurs whenever the dialog is first displayed.
/// </summary>
public event EventHandler Shown;
ApplyButton(ButtonPosition.Negative, null);
ApplyContent(null);
- UngrabBackKey();
-
base.OnUnrealize();
}
/// <remarks>When shown, the dialog will register itself for the back key press event handling.</remarks>
protected virtual void OnShown()
{
- GrabBackKey();
}
/// <summary>
/// <remarks>When dismissed, the dialog will unregister itself from the back key press event handling.</remarks>
protected virtual void OnDismissed()
{
- UngrabBackKey();
}
/// <summary>
{
OnShown();
};
-
- // Adds a handler for the KeyUp event.
- // The handler checks whether the key just pressed is a back key
- // and if that is the case, invokes the back button press handler of this instance.
- KeyUp += (s, e) =>
- {
- if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
- BackButtonPressed?.Invoke(this, EventArgs.Empty);
- };
}
/// <summary>
SetPartContent("default", _content, true);
}
-
- /// <summary>
- /// Registers this instance to be affected by pressing the hardware back key.
- /// </summary>
- void GrabBackKey()
- {
- KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, true);
- }
-
- /// <summary>
- /// Unregisters this instance from being affected by pressing the hardware back key.
- /// </summary>
- void UngrabBackKey()
- {
- KeyUngrab(EvasKeyEventArgs.PlatformBackButtonName);
- }
-
}
}
public event EventHandler Closed;
/// <summary>
- /// Notifies that the back button has been pressed.
- /// </summary>
- public event EventHandler BackButtonPressed;
-
- /// <summary>
/// Gets the current orientation.
/// </summary>
public DisplayOrientations CurrentOrientation
Unrealize();
};
- KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false);
- KeyUp += (s, e) =>
- {
- if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
- {
- BackButtonPressed?.Invoke(this, EventArgs.Empty);
- }
- };
-
Active();
AutoDeletion = false;
Show();
<PackageReference Include="Tizen" Version="1.0.5" />
<PackageReference Include="Tizen.Applications.Common" Version="1.5.5" />
<PackageReference Include="Tizen.Applications.UI" Version="1.5.5" />
- <PackageReference Include="ElmSharp" Version="1.1.0-beta-022" />
+ <PackageReference Include="ElmSharp" Version="1.1.0-beta-024" />
<PackageReference Include="System.Runtime.Serialization.Xml" Version="4.3.0" />
<PackageReference Include="Tizen.System.Information" Version="1.0.2" />
<PackageReference Include="Tizen.WebView" Version="1.0.0" />