Skip to content

DataTemplateView may not work in some cases #396

@hxYuki

Description

@hxYuki

For example, MenuItemTemplate from FluentAvalonia.NavigationView. The viewFunc can be triggered, but the view is not applied.
You have to use builtin FuncDataTemplate instead.

It seems that it's because of NavigationView requiring NavigationViewItem as top element in template. And it doesn't fit the restriction.

Is there a different behavior from FuncDataTemplate or something I did wrong?

// this works
FuncDataTemplate<string>(fun value scope ->
    let nvi = NavigationViewItem()
    nvi.Content <- value + "!!!"

    nvi)

// this doesn't work
DataTemplateView<_, _>.create (fun item ->
    create<NavigationViewItem> [] (fun nv -> nv.Content <- (item + "!!!"))) // my wrapper calling `init` and ViewBuilder for third party controls

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions