Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9113685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:01:13+00:00 2026-06-17T04:01:13+00:00

I got some issues while trying to bind an ObservableCollection made from 2 others.

  • 0

I got some issues while trying to bind an ObservableCollection made from 2 others.
First I need to bind ActiveSketchs, Second i have to bind Sketchs (Which is ActivesSketchs.Union(InactiveSketchs) separately.

I thought the code below would work but it doesn’t. The ActiveSketch binding works correctly, but not the Sketchs one :

    private ObservableCollection<Sketch> _sketchs;
    public ObservableCollection<Sketch> Sketchs
    {
        get { return _sketchs = new ObservableCollection<Sketch>(ActiveSketchs.Union(InactiveSketchs)); }
        set { _sketchs = value; }
    }

    private ObservableCollection<Sketch> _activeSketchs;
    public ObservableCollection<Sketch> ActiveSketchs
    {
        get { return _activeSketchs; }
        set { _activeSketchs = value; }
    }

    private ObservableCollection<Sketch> _inactiveSketchs;
    public ObservableCollection<Sketch> InactiveSketchs
    {
        get { return _inactiveSketchs; }
        set { _inactiveSketchs = value; }
    }

And here’s how i set the source item :

    HeadbandRight.ItemsSource = Sketchs;
    HeadbandLeft.ItemsSource = Sketchs;
    MainScatterViewer.ItemsSource = ActiveSketchs;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:01:14+00:00Added an answer on June 17, 2026 at 4:01 am

    You should use a CollectionViewSource to get filtered items from your list :

    public InitFunction()
    {
        this.Sketchs = new ObservableCollection<Sketch>();
    
        this.ActiveSketchs = new CollectionViewSource();
        this.ActiveSketchs.Source = this.Sketches ;
        this.ActiveSketchs.Filter += (s, e) =>
        {
            var sketch = e.Item as Sketch;
    
            e.Accepted = sketch.IsActive; // or whatever test you need
        };
    
        HeadbandRight.ItemsSource = Sketchs;
        HeadbandLeft.ItemsSource = Sketchs;
        MainScatterViewer.ItemsSource = ActiveSketchs.View;
    }
    
    public ObservableCollection<Sketch> Sketchs { get; set; }
    
    public CollectionViewSource ActiveSketchs { get; set; }
    

    Full example here : http://uicraftsman.com/blog/2010/10/27/filtering-data-using-collectionviewsource/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I've had some issues while trying to come over from Latin1 encoded databases,
While trying to resolve some debugging issues , I added some printf -s to
I got some kind of weird behavior while trying to use all the power
I have some code that has got me very close to what Im trying
I got this error while trying to get facebook access_token from node.js server: {error:{message:(#803)
I'm having some issues with while loops. I've got a task to print a
I was testing my mobile application, with Windows mobile.I got some issues with the
I try to do static class, add to icollection but i got some issues
I got stumbled upon this issue once and I guess I need some expertise
Got 3 tables I need to connect. Got my first project where I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.