-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add bindings Avalonia v11.0.0 #422
Add bindings Avalonia v11.0.0 #422
Conversation
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.
LGTM, nice work!
- fix strokeDashArray<'t>(value: double list) implementation - rename binding name: strokeJoinCap -> strokeJoin
- remove create function ... TextElement is AbstractClass. - add AttachedProperty bindings.
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.
note: GestureRecognizers
AvaloniaUI/Avalonia/issues/12558
@JaggerJo @Numpsy In this PR, I've been renaming/removing existing bindings and such when I notice cases, such as:
Should I include significant changes that require adjustments by users of FuncUI in this PR, other than the above? diff --git a/src/Avalonia.FuncUI/DSL/Calendar/Calendar.fs b/src/Avalonia.FuncUI/DSL/Calendar/Calendar.fs
index 72008a8..6cc35d1 100644
--- a/src/Avalonia.FuncUI/DSL/Calendar/Calendar.fs
+++ b/src/Avalonia.FuncUI/DSL/Calendar/Calendar.fs
@@ -16,6 +16,19 @@ module Calendar =
type Calendar with
+ static member onDisplayModeChanged<'t when 't :> Calendar>(func: CalendarModeChangedEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
+ let name = nameof Unchecked.defaultof<'t>.DisplayModeChanged
+ let factory: SubscriptionFactory<CalendarModeChangedEventArgs> =
+ fun (control, func, token) ->
+ let control = control :?> 't
+ let handler = EventHandler<CalendarModeChangedEventArgs>(fun s e -> func e)
+ let event = control.DisplayModeChanged
+
+ event.AddHandler(handler)
+ token.Register(fun () -> event.RemoveHandler(handler)) |> ignore
+
+ AttrBuilder<'t>.CreateSubscription(name, factory, func, ?subPatchOptions = subPatchOptions)
+
static member firstDayOfWeek<'t when 't :> Calendar>(value: DayOfWeek) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty<DayOfWeek>(Calendar.FirstDayOfWeekProperty, value, ValueNone)
@@ -31,9 +44,6 @@ module Calendar =
static member displayMode<'t when 't :> Calendar>(value: CalendarMode) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty<CalendarMode>(Calendar.DisplayModeProperty, value, ValueNone)
- static member onDisplayModeChanged<'t when 't :> Calendar>(func: CalendarMode -> unit, ?subPatchOptions) : IAttr<'t> =
- AttrBuilder<'t>.CreateSubscription<CalendarMode>(Calendar.DisplayModeProperty, func, ?subPatchOptions = subPatchOptions)
-
static member selectionMode<'t when 't :> Calendar>(value: CalendarSelectionMode) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty<CalendarSelectionMode>(Calendar.SelectionModeProperty, value, ValueNone)
|
Maybe put bigger breaking changes in an extra PR so we can discuss the separately. 👍 |
Thank you. I will do as you suggested. |
- add missing bindings. - change attached bindings - allowAutoHide - remove bindings that setter is not accessible. - extent - viewport - isExpanded - smallChange - largeChange
@SilkyFowl I'm quite baffled with just how many bindings were missing 😅 |
@JaggerJo I'm also surprised. Actually, I'm creating a draft to find the classes and their members that should generate the DSL from the specified assembly. |
@SilkyFowl can I merge this? |
This is a continuation of #420.
It adds the bindings that are missing as of Avalonia v11.0.0.
This might become a larger PR than the previous one. Would it be better to create a tracking issue and split the PR?