-
Notifications
You must be signed in to change notification settings - Fork 468
Bindable property for Popup #2991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
c8542d0
61e0665
d25d65b
4ce6542
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,71 +8,47 @@ namespace CommunityToolkit.Maui; | |||||||||||||||
| public partial class PopupOptions : BindableObject, IPopupOptions | ||||||||||||||||
| { | ||||||||||||||||
| /// <summary> | ||||||||||||||||
| /// Backing BindableProperty for the <see cref="CanBeDismissedByTappingOutsideOfPopup"/> property. | ||||||||||||||||
| /// Gets or sets a value indicating whether the popup can be dismissed by tapping outside of the popup. | ||||||||||||||||
| /// Default is provided by <see cref="Options.DefaultPopupOptionsSettings"/>. | ||||||||||||||||
| /// </summary> | ||||||||||||||||
| public static readonly BindableProperty CanBeDismissedByTappingOutsideOfPopupProperty = BindableProperty.Create(nameof(CanBeDismissedByTappingOutsideOfPopup), typeof(bool), typeof(PopupOptions), Options.DefaultPopupOptionsSettings.CanBeDismissedByTappingOutsideOfPopup); | ||||||||||||||||
| [BindableProperty(DefaultValueCreatorMethodName = nameof(CreateCanBeDismissedByTappingOutsideOfPopup))] | ||||||||||||||||
| public partial bool CanBeDismissedByTappingOutsideOfPopup { get; set; } | ||||||||||||||||
| static object CreateCanBeDismissedByTappingOutsideOfPopup(BindableObject? _) => Options.DefaultPopupOptionsSettings.CanBeDismissedByTappingOutsideOfPopup; | ||||||||||||||||
|
|
||||||||||||||||
| /// <summary> | ||||||||||||||||
| /// Backing BindableProperty for the <see cref="OnTappingOutsideOfPopup"/> property. | ||||||||||||||||
| /// Gets or sets an <see cref="Action"/> invoked when the user taps outside of the popup. | ||||||||||||||||
| /// Default is provided by <see cref="Options.DefaultPopupOptionsSettings"/>. | ||||||||||||||||
| /// </summary> | ||||||||||||||||
| public static readonly BindableProperty OnTappingOutsideOfPopupProperty = BindableProperty.Create(nameof(OnTappingOutsideOfPopup), typeof(Action), typeof(PopupOptions), Options.DefaultPopupOptionsSettings.OnTappingOutsideOfPopup); | ||||||||||||||||
| [BindableProperty(DefaultValueCreatorMethodName = nameof(CreateOnTappingOutsideOfPopup))] | ||||||||||||||||
| public partial Action? OnTappingOutsideOfPopup { get; set; } | ||||||||||||||||
| static object? CreateOnTappingOutsideOfPopup(BindableObject? _) => Options.DefaultPopupOptionsSettings.OnTappingOutsideOfPopup; | ||||||||||||||||
|
Comment on lines
+23
to
+24
|
||||||||||||||||
|
|
||||||||||||||||
| /// <summary> | ||||||||||||||||
| /// Backing BindableProperty for the <see cref="PageOverlayColor"/> property. | ||||||||||||||||
| /// Gets or sets the overlay <see cref="Color"/> applied to the page while the popup is displayed. | ||||||||||||||||
| /// Default is provided by <see cref="Options.DefaultPopupOptionsSettings"/>. | ||||||||||||||||
| /// </summary> | ||||||||||||||||
| public static readonly BindableProperty PageOverlayColorProperty = BindableProperty.Create(nameof(PageOverlayColor), typeof(Color), typeof(PopupOptions), Options.DefaultPopupOptionsSettings.PageOverlayColor); | ||||||||||||||||
| [BindableProperty(DefaultValueCreatorMethodName = nameof(CreatePageOverlayColor))] | ||||||||||||||||
| public partial Color PageOverlayColor { get; set; } | ||||||||||||||||
| static object CreatePageOverlayColor(BindableObject? _) => Options.DefaultPopupOptionsSettings.PageOverlayColor; | ||||||||||||||||
|
||||||||||||||||
| static object CreatePageOverlayColor(BindableObject? _) => Options.DefaultPopupOptionsSettings.PageOverlayColor; | |
| static object CreatePageOverlayColor(BindableObject? _) | |
| { | |
| return Options.DefaultPopupOptionsSettings.PageOverlayColor is not null | |
| ? Options.DefaultPopupOptionsSettings.PageOverlayColor | |
| : Colors.Transparent; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The
using System.ComponentModel;directive doesn't appear to be used in this file. The[BindableProperty]attribute is defined in theCommunityToolkit.Mauinamespace (auto-generated by the source generator), notSystem.ComponentModel.If this directive is not used elsewhere in the file, consider removing it to keep imports clean.