Skip to content

Commit

Permalink
Change DataTemplateView.itemsSource from a Linq.Expression to a regul…
Browse files Browse the repository at this point in the history
…ar Func<>
  • Loading branch information
Numpsy committed Mar 11, 2024
1 parent 1d562ee commit 99175cf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Avalonia.FuncUI/DataTemplateView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ open Avalonia.FuncUI.Library
open Avalonia.FuncUI.Types
open Avalonia.FuncUI.Hosts
open Avalonia.Data
open System.Linq.Expressions

type DataTemplateView<'data, 'childData, 'view when 'view :> IView>
(viewFunc: 'data -> 'view,
matchFunc: ('data -> bool) voption,
itemsSource: Expression<Func<'data, 'childData seq>> voption,
itemsSource: Func<'data, 'childData seq> voption,
supportsRecycling: bool) =

member this.ViewFunc = viewFunc
Expand All @@ -39,7 +38,7 @@ type DataTemplateView<'data, 'childData, 'view when 'view :> IView>
| ValueSome expression ->
match item with
| :? 'data as data ->
InstancedBinding.OneTime(expression.Compile().Invoke(data))
InstancedBinding.OneTime(expression.Invoke(data))
| _ -> null

member this.Match (data: obj) : bool =
Expand Down

0 comments on commit 99175cf

Please sign in to comment.