/// DialogPage contains dialog and dimmed scrim behind the dialog.
/// </summary>
/// <since_tizen> 9 </since_tizen>
- public class DialogPage : Page
+ public partial class DialogPage : Page
{
private View content = null;
private View scrim = null;
private bool enableScrim = true;
- /// <summary>
- /// Creates a new instance of a DialogPage.
- /// </summary>
- /// <since_tizen> 9 </since_tizen>
- public DialogPage() : base()
+ private void Initialize()
{
Layout = new AbsoluteLayout();
}
/// <summary>
+ /// Creates a new instance of a DialogPage.
+ /// </summary>
+ /// <since_tizen> 9 </since_tizen>
+ public DialogPage() : base()
+ {
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of DialogPage with style.
+ /// </summary>
+ /// <param name="style">Creates DialogPage by special style defined in UX.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public DialogPage(string style) : base(style)
+ {
+ Initialize();
+ }
+
+ /// <summary>
+ /// Creates a new instance of a DialogPage with style.
+ /// </summary>
+ /// <param name="style">A style applied to the newly created DialogPage.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public DialogPage(ControlStyle style) : base(style)
+ {
+ Initialize();
+ }
+
+ /// <summary>
/// Dispose DialogPage and all children on it.
/// </summary>
/// <param name="type">Dispose type.</param>
{
get
{
+ return GetValue(ContentProperty) as View;
+ }
+ set
+ {
+ SetValue(ContentProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+ private View InternalContent
+ {
+ get
+ {
return content;
}
set
{
get
{
+ return (bool)GetValue(EnableScrimProperty);
+ }
+ set
+ {
+ SetValue(EnableScrimProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+ private bool InternalEnableScrim
+ {
+ get
+ {
return enableScrim;
}
set
/// Indicates to dismiss dialog by touching on scrim.
/// </summary>
/// <since_tizen> 9 </since_tizen>
- public bool EnableDismissOnScrim { get; set; } = true;
+ public bool EnableDismissOnScrim
+ {
+ get
+ {
+ return (bool)GetValue(EnableDismissOnScrimProperty);
+ }
+ set
+ {
+ SetValue(EnableDismissOnScrimProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+ private bool InternalEnableDismissOnScrim { get; set; } = true;
/// <summary>
/// The color of scrim.
{
get
{
+ return GetValue(ScrimColorProperty) as Color;
+ }
+ set
+ {
+ SetValue(ScrimColorProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+ private Color InternalScrimColor
+ {
+ get
+ {
return Scrim?.BackgroundColor;
}
set
private View CreateDefaultScrim()
{
- //FIXME: Needs to separate GUI implementation codes to style cs file.
- var scrim = new VisualView();
- scrim.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.5f);
+ var scrimStyle = ThemeManager.GetStyle("Tizen.NUI.Components.DialogPage.Scrim");
+ var scrim = new VisualView(scrimStyle);
//FIXME: Needs to set proper size to Scrim.
scrim.Size = NUIApplication.GetDefaultWindow().Size;
scrim.TouchEvent += (object source, TouchEventArgs e) =>
}
return true;
};
+ scrim.DispatchParentGestureEvents = false;
return scrim;
}