public static readonly BindableProperty ButtonHeightProperty = BindableProperty.Create(nameof(ButtonHeight), typeof(int), typeof(Popup), default(int), propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (Popup)bindable;
- if (newValue != null && instance?.Style?.Buttons?.Size != null )
+ if (newValue != null && instance?.popupStyle?.Buttons?.Size != null )
{
- instance.Style.Buttons.Size.Height = (int)newValue;
+ instance.popupStyle.Buttons.Size.Height = (int)newValue;
instance.btGroup.Itemheight = (int)newValue;
instance.UpdateView();
}
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return (int)(instance.Style?.Buttons?.Size?.Height ?? 0);
+ return (int)(instance.popupStyle?.Buttons?.Size?.Height ?? 0);
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
if (newValue != null)
{
- if (instance.Style?.Buttons?.Text != null)
+ if (instance.popupStyle?.Buttons?.Text != null)
{
- instance.Style.Buttons.Text.PointSize = (float)newValue;
+ instance.popupStyle.Buttons.Text.PointSize = (float)newValue;
}
instance.btGroup.ItemPointSize = (float)newValue;
}
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style?.Buttons?.Text?.PointSize?.All ?? 0;
+ return instance.popupStyle?.Buttons?.Text?.PointSize?.All ?? 0;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
if (newValue != null)
{
- instance.Style.Buttons.Text.FontFamily = (string)newValue;
+ instance.popupStyle.Buttons.Text.FontFamily = (string)newValue;
instance.btGroup.ItemFontFamily = (string)newValue;
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style?.Buttons?.Text?.FontFamily.All;
+ return instance.popupStyle?.Buttons?.Text?.FontFamily.All;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
if (newValue != null)
{
- if (instance.Style?.Buttons?.Text != null)
+ if (instance.popupStyle?.Buttons?.Text != null)
{
- instance.Style.Buttons.Text.TextColor = (Color)newValue;
+ instance.popupStyle.Buttons.Text.TextColor = (Color)newValue;
}
instance.btGroup.ItemTextColor = (Color)newValue;
}
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style?.Buttons?.Text?.TextColor?.All;
+ return instance.popupStyle?.Buttons?.Text?.TextColor?.All;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
if (newValue != null)
{
- instance.Style.Buttons.Overlay.BackgroundColor = (Selector<Color>)newValue;
+ instance.popupStyle.Buttons.Overlay.BackgroundColor = (Selector<Color>)newValue;
instance.btGroup.OverLayBackgroundColorSelector = (Selector<Color>)newValue;
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style?.Buttons?.Overlay?.BackgroundColor;
+ return instance.popupStyle?.Buttons?.Overlay?.BackgroundColor;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
if (newValue != null)
{
- instance.Style.Buttons.Text.HorizontalAlignment = (HorizontalAlignment)newValue;
+ instance.popupStyle.Buttons.Text.HorizontalAlignment = (HorizontalAlignment)newValue;
instance.btGroup.ItemTextAlignment = (HorizontalAlignment)newValue;
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style?.Buttons?.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ return instance.popupStyle?.Buttons?.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
if (newValue != null)
{
- if (instance.Style.Buttons.BackgroundImage == null)
+ if (instance.popupStyle.Buttons.BackgroundImage == null)
{
- instance.Style.Buttons.BackgroundImage = new Selector<string>();
+ instance.popupStyle.Buttons.BackgroundImage = new Selector<string>();
}
+ instance.popupStyle.Buttons.BackgroundColor = new Selector<Color>();
+ instance.popupStyle.Buttons.BackgroundImage = (string)newValue;
instance.btGroup.ItemBackgroundImageUrl = (string)newValue;
- instance.Style.Buttons.BackgroundImage = (string)newValue;
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style?.Buttons?.BackgroundImage?.All;
+ return instance.popupStyle?.Buttons?.BackgroundImage?.All;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
if (newValue != null)
{
- if (instance.Style.Buttons.BackgroundImageBorder == null)
+ if (instance.popupStyle.Buttons.BackgroundImageBorder == null)
{
- instance.Style.Buttons.BackgroundImageBorder = new Selector<Rectangle>();
+ instance.popupStyle.Buttons.BackgroundImageBorder = new Selector<Rectangle>();
}
- instance.Style.Buttons.BackgroundImageBorder = (Rectangle)newValue;
+ instance.popupStyle.Buttons.BackgroundImageBorder = (Rectangle)newValue;
instance.btGroup.ItemBackgroundBorder = (Rectangle)newValue;
}
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style?.Buttons?.BackgroundImageBorder?.All;
+ return instance.popupStyle?.Buttons?.BackgroundImageBorder?.All;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
var instance = (Popup)bindable;
ImageShadow shadow = (ImageShadow)newValue;
instance.btGroup.ItemImageShadow = new ImageShadow(shadow);
- instance.Style.Buttons.ImageShadow = new ImageShadow(shadow);
+ instance.popupStyle.Buttons.ImageShadow = new ImageShadow(shadow);
},
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style?.Buttons?.ImageShadow?.All;
+ return instance.popupStyle?.Buttons?.ImageShadow?.All;
});
+ private PopupStyle popupStyle => ViewStyle as PopupStyle;
private TextLabel titleText;
private ButtonGroup btGroup = null;
private Window window = null;
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddButton(string buttonText)
{
- if (Style.Buttons != null)
+ if (popupStyle.Buttons != null)
{
- Button btn = new Button(Style.Buttons);
- btn.Style.Text.Text = buttonText;
+ Button btn = new Button(popupStyle.Buttons);
+ btn.Text = buttonText;
btn.ClickEvent += ButtonClickEvent;
btGroup.AddItem(btn);
UpdateView();
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddButton(string buttonText, ButtonStyle style)
{
- if (Style.Buttons != null && style != null)
+ if (popupStyle.Buttons != null && style != null)
{
- Style.Buttons.CopyFrom(style);
+ popupStyle.Buttons.CopyFrom(style);
AddButton(buttonText);
}
}
/// Get style of popup.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public new PopupStyle Style => ViewStyle as PopupStyle;
+ public new PopupStyle Style
+ {
+ get
+ {
+ var result = new PopupStyle(popupStyle);
+ result.CopyPropertiesFromView(this);
+ result.Title.CopyPropertiesFromView(titleText);
+ return result;
+ }
+ }
/// <summary>
/// Popup Title.
{
get
{
- return Style?.Title?.Text?.All;
+ return popupStyle?.Title?.Text?.All;
}
set
{
if (value != null)
{
- if (Style?.Title != null)
+ if (popupStyle?.Title != null)
{
- Style.Title.Text = value;
+ popupStyle.Title.Text = value;
}
}
}
{
get
{
- return Style?.Title?.PointSize?.All ?? 0;
+ return popupStyle?.Title?.PointSize?.All ?? 0;
}
set
{
- if (Style?.Title != null)
+ if (popupStyle?.Title != null)
{
- Style.Title.PointSize = value;
+ popupStyle.Title.PointSize = value;
}
}
}
{
get
{
- return Style?.Title?.TextColor?.All;
+ return popupStyle?.Title?.TextColor?.All;
}
set
{
- if (Style?.Title != null)
+ if (popupStyle?.Title != null)
{
- Style.Title.TextColor = value;
+ popupStyle.Title.TextColor = value;
}
}
}
{
get
{
- return Style?.Title?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ return popupStyle?.Title?.HorizontalAlignment ?? HorizontalAlignment.Center;
}
set
{
- Style.Title.HorizontalAlignment = value;
+ popupStyle.Title.HorizontalAlignment = value;
}
}
{
get
{
- return Style?.Title?.Position ?? new Position(0, 0, 0);
+ return popupStyle?.Title?.Position ?? new Position(0, 0, 0);
}
set
{
- Style.Title.Position = value;
+ popupStyle.Title.Position = value;
}
}
{
get
{
- return (int)(Style?.Title?.Size?.Height ?? 0);
+ return (int)(popupStyle?.Title?.Size?.Height ?? 0);
}
set
{
- if (Style?.Title?.Size != null)
+ if (popupStyle?.Title?.Size != null)
{
- Style.Title.Size.Height = value;
+ popupStyle.Title.Size.Height = value;
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- PopupStyle popupStyle = StyleManager.Instance.GetViewStyle(StyleName) as PopupStyle;
- if (popupStyle != null)
+ PopupStyle ppStyle = StyleManager.Instance.GetViewStyle(StyleName) as PopupStyle;
+ if (ppStyle != null)
{
- string strSaveTitleText = TitleText;
- Style.CopyFrom(popupStyle);
- Style.Title.Text = strSaveTitleText;
+ ApplyStyle(ppStyle);
UpdateView();
}
}
private void UpdateView()
{
- btGroup.UpdateButton(Style.Buttons);
+ btGroup.UpdateButton(popupStyle.Buttons);
UpdateContentView();
UpdateTitle();
}
{
if (e.PropertyName.Equals("LayoutDirection"))
{
- btGroup.UpdateButton(Style.Buttons);
+ btGroup.UpdateButton(popupStyle.Buttons);
}
}
int titleY = 0;
int titleH = 0;
int buttonH = 0;
- string strText = Style.Title.Text.All;
- if (!string.IsNullOrEmpty(strText) && Style.Title.Size != null)
+ string strText = Title.Text;
+ if (!string.IsNullOrEmpty(strText) && Title.Size != null)
{
titleH = (int)titleText.Size.Height;
}
- if (!string.IsNullOrEmpty(strText) && Style.Title.Position != null)
+ if (!string.IsNullOrEmpty(strText) && Title.Position != null)
{
- titleX = (int)Style.Title.Position.X;
- titleY = (int)Style.Title.Position.Y;
+ titleX = (int)Title.Position.X;
+ titleY = (int)Title.Position.Y;
}
- if (btGroup.Count != 0 && Style?.Buttons?.Size != null )
+ if (btGroup.Count != 0 && popupStyle?.Buttons?.Size != null )
{
- buttonH = (int)Style.Buttons.Size.Height;
+ buttonH = (int)popupStyle.Buttons.Size.Height;
}
ContentView.Size = new Size(Size.Width - titleX * 2, Size.Height - titleY - titleH - buttonH);
ContentView.Position = new Position(titleX, titleY + titleH);
private void UpdateTitle()
{
- if (titleText != null && string.IsNullOrEmpty(Style.Title.Text.All) && Style.Title.Size != null)
+ if (titleText != null && string.IsNullOrEmpty(popupStyle.Title.Text.All) && popupStyle.Title.Size != null)
{
titleText.RaiseToTop();
}