Skip to content

Building dynamic filters: Getting an Observable to use on Filter() when any subproperty of an collection change #1028

Answered by JakenVeina
Dunge asked this question in Q&A
Discussion options

You must be logged in to vote

There's a bit too much missing context here for me to diagnose exactly what you're missing, but it's likely something in you filter stream logic. I.E. it's not emitting notifications for certain filter changes that you're interested in. I can definitely give you a working example of how I would do this...

public static class EntryPoint
{
    public static void Main()
    {
        using var devicesList = new DevicesListViewModel();

        using var subscription = devicesList.FilteredDevices
            .ObserveCollectionChanges()
            .Subscribe(_ =>
            {
                Console.WriteLine("\tFiltered Devices:");
                if (devicesList.FilteredDevices.Count is 0)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Dunge
Comment options

@JakenVeina
Comment options

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