Skip to content

Commit

Permalink
Add theme binding (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
melursus23 committed Apr 9, 2023
1 parent f53800e commit 04b300c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Avalonia.FuncUI/DSL/Base/StyledElement.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ module StyledElement =

static member templatedParent<'t when 't :> StyledElement>(template: TemplatedControl) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty<AvaloniaObject>(StyledElement.TemplatedParentProperty, template, ValueNone)


static member theme<'t when 't :> StyledElement>(theme: ControlTheme) : IAttr<'t> =
AttrBuilder<'t>.CreateProperty<ControlTheme>(StyledElement.ThemeProperty, theme, ValueNone)

static member classes<'t when 't :> StyledElement>(value: Classes) : IAttr<'t> =
let getter : ('t -> Classes) = (fun control -> control.Classes)
let setter : ('t * Classes -> unit) = (fun (control, value) -> control.Classes <- value)
Expand Down

0 comments on commit 04b300c

Please sign in to comment.