D
D
Denis Mashanov2017-11-25 13:37:42
WPF
Denis Mashanov, 2017-11-25 13:37:42

How to write data from a list to a CollectionViewSource resource?

Good day to all. I have a question, how can I write to the CollectionViewSource resource the data that is in the List (List) with the object type?
var datatable = new List<object>();

<Window.Resources>
        <local:Tasks x:Key="tasks"/>
        <CollectionViewSource x:Key="cvsTasks" Source="{StaticResource tasks}" Filter="CollectionViewSource_Filter"/>
    </Window.Resources>

5a194fdf2e868496363091.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Mashanov, 2017-11-25
@LoneRay

CollectionViewSource collection = TryFindResource("cvsTasks") as CollectionViewSource;
            collection.Source = _tasks;

where _tasks
List<object> _tasks = new List<object>();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question