Skip to content

The correct way to use FeedView with C # markup? #18333

Answered by bitbltr
qhj asked this question in Q&A
Discussion options

You must be logged in to vote

I struggled and finally figured it out. I don't remember where I saw the inspiration, if it was here or Stack Overflow. Something like this:

new FeedView()
    .Source(() => vm.MyDataSource)
    .ValueTemplate<FeedViewState>(feedViewState =>
        new ListView()
            .ItemsSource(() => feedViewState.Data!)
            .ItemTemplate<MyItemType>(item => new TextBlock().Text(() => item.SomeStringValue)))

FeedViewState is internal to FeedView and the .Data property is your data source

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MartinZikmund
Comment options

Answer selected by MartinZikmund
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants