Skip to content

Commit

Permalink
add Expander bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
SilkyFowl committed May 14, 2024
1 parent cd4d413 commit c68392e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Avalonia.FuncUI/DSL/Expander.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
module Expander =
open Avalonia.Animation
open Avalonia.Controls
open Avalonia.Interactivity
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Builder

Expand All @@ -12,6 +13,18 @@ module Expander =

type Expander with

static member onCollapsed<'t when 't :> Expander>(func: RoutedEventArgs -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription<RoutedEventArgs>(Expander.CollapsedEvent, func, ?subPatchOptions = subPatchOptions)

static member onCollapsing<'t when 't :> Expander>(func: CancelRoutedEventArgs -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription<CancelRoutedEventArgs>(Expander.CollapsingEvent, func, ?subPatchOptions = subPatchOptions)

static member onExpanded<'t when 't :> Expander>(func: RoutedEventArgs -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription<RoutedEventArgs>(Expander.ExpandedEvent, func, ?subPatchOptions = subPatchOptions)

static member onExpanding<'t when 't :> Expander>(func: CancelRoutedEventArgs -> unit, ?subPatchOptions) =
AttrBuilder<'t>.CreateSubscription<CancelRoutedEventArgs>(Expander.ExpandingEvent, func, ?subPatchOptions = subPatchOptions)

static member contentTransition<'t when 't :> Expander>(value: IPageTransition) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty<IPageTransition>(Expander.ContentTransitionProperty, value, ValueNone)

Expand Down

0 comments on commit c68392e

Please sign in to comment.