Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion maui/src/Popup/PopupCloseButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ protected override void OnDraw(ICanvas canvas, RectF rectF)
_closeButtonImage.IsVisible = false;
}

canvas.StrokeColor = _popupView._popup.PopupStyle.GetCloseButtonIconStroke();
canvas.StrokeColor = _popupView._popup.PopupStyle.GetCloseIconColor();
canvas.StrokeSize = (float)_popupView._popup.PopupStyle.GetCloseButtonIconStrokeThickness();
PointF firstLine = new Point(0, 0);
PointF secondLine = new Point(0, 0);
Expand Down
39 changes: 26 additions & 13 deletions maui/src/Popup/Style/PopupStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ public class PopupStyle : Element, IThemeElement
BindableProperty.Create(nameof(CloseButtonIcon), typeof(ImageSource), typeof(PopupStyle), null);

/// <summary>
/// Identifies the <see cref="CloseButtonIconStroke"/> <see cref="BindableProperty"/>.
/// Identifies the <see cref="CloseIconColor"/> <see cref="BindableProperty"/>.
/// </summary>
internal static BindableProperty CloseButtonIconStrokeProperty =
BindableProperty.Create(nameof(CloseButtonIconStroke), typeof(Color), typeof(PopupStyle), defaultValue: Color.FromArgb("#49454F"));
public static BindableProperty CloseIconColorProperty =
BindableProperty.Create(nameof(CloseIconColor), typeof(Color), typeof(PopupStyle), defaultValue: Color.FromArgb("#49454F"));

/// <summary>
/// Identifies the <see cref="CloseButtonIconStrokeThickness"/> <see cref="BindableProperty"/>.
Expand Down Expand Up @@ -924,19 +924,32 @@ public ImageSource CloseButtonIcon
set => SetValue(CloseButtonIconProperty, value);
}

#endregion

#region Internal Properties

/// <summary>
/// Gets or sets the icon color for close button.
/// Gets or sets the color of the close icon displayed in the <see cref="SfPopup"/>.
/// </summary>
internal Color CloseButtonIconStroke
/// <example>
/// <para>The following code example demonstrates how to set <see cref="CloseIconColor"/> for the <see cref="SfPopup"/> control.</para>
/// <code lang="XAML">
/// <![CDATA[
/// <popup:SfPopup x:Name="popup">
/// <popup:SfPopup.PopupStyle>
/// <popup:PopupStyle CloseIconColor="Red" />
/// </popup:SfPopup.PopupStyle>
/// </popup:SfPopup>
/// ]]>
/// </code>
/// </example>
/// <seealso cref="SfPopup.ShowCloseButton"/>
public Color CloseIconColor
{
get => (Color)GetValue(CloseButtonIconStrokeProperty);
set => SetValue(CloseButtonIconStrokeProperty, value);
get => (Color)GetValue(CloseIconColorProperty);
set => SetValue(CloseIconColorProperty, value);
}

#endregion

#region Internal Properties

/// <summary>
/// Gets or sets the icon stroke thickness for close button.
/// </summary>
Expand Down Expand Up @@ -1113,7 +1126,7 @@ void IThemeElement.OnCommonThemeChanged(string oldTheme, string newTheme)
/// Gets the icon color for close button.
/// </summary>
/// <returns> icon color for close button.</returns>
internal Color GetCloseButtonIconStroke() => CloseButtonIconStroke;
internal Color GetCloseIconColor() => CloseIconColor;

/// <summary>
/// Gets the icon stroke thickness for close button.
Expand Down Expand Up @@ -1160,7 +1173,7 @@ internal void SetThemeProperties(SfPopup popup)
ApplyDynamicResource(HeaderFontSizeProperty, "SfPopupNormalHeaderFontSize");
ApplyDynamicResource(MessageFontSizeProperty, "SfPopupNormalMessageFontSize");
ApplyDynamicResource(FooterFontSizeProperty, "SfPopupNormalFooterFontSize");
ApplyDynamicResource(CloseButtonIconStrokeProperty, "SfPopupNormalCloseButtonIconStroke");
ApplyDynamicResource(CloseIconColorProperty, "SfPopupNormalCloseButtonIconStroke");
ApplyDynamicResource(CloseButtonIconStrokeThicknessProperty, "SfPopupNormalCloseButtonIconStrokeThickness");
ApplyDynamicResource(HoveredCloseButtonIconBackgroundProperty, "SfPopupHoverCloseButtonIconBackground");
ApplyDynamicResource(PressedCloseButtonIconBackgroundProperty, "SfPopupPressedCloseButtonIconBackground");
Expand Down