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

  • Home
  • SEARCH
  • 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 89471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:43:18+00:00 2026-05-10T22:43:18+00:00

I currently have a collection with a HasChanges property on it (each object in

  • 0

I currently have a collection with a HasChanges property on it (each object in the collection also has its own HasChanges property) and the collection is the source of my CollectionViewSource.

When I try to databind the HasChanges property of the collection behind the CollectionViewSource to one of my custom controls, it binds to the HasChanges property of the currently selected object, instead of HasChanges property of the CollectionViewSource’s source collection. Is there a way that I can explicitly tell the binding to look on the collection object rather than the objects in the collection?

My code looks something like this:

<Window x:Class='CollectionEditWindow'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     xmlns:Local='clr-namespace:My.Local.Namespace;assembly=My.Local.Namespace'>     <Window.Resources>         <CollectionViewSource x:Name='CVS' x:Key='MyCollectionViewSource' />     </Window.Resources>  <Local:MyCustomControl HasChanges='{Binding HasChanges, Source={StaticResource                           MyCollectionViewSource}}'> <!-- Code to set up the databinding of the custom control to the CollectionViewSource--> </Local:MyCustomControl> </Window> 

Thanks.

  • 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. 2026-05-10T22:43:19+00:00Added an answer on May 10, 2026 at 10:43 pm

    When you bind to CollectionViewSource you get a CollectionView, which has a SourceCollection property that you can use to get the collection behind the CollectionViewSource, like so:

    <Grid xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'       xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'       xmlns:sys='clr-namespace:System;assembly=mscorlib'>     <Grid.Resources>         <x:Array x:Key='data' Type='{x:Type sys:String}'>             <sys:String>a</sys:String>             <sys:String>bb</sys:String>             <sys:String>ccc</sys:String>             <sys:String>dddd</sys:String>         </x:Array>         <CollectionViewSource x:Key='cvsData' Source='{StaticResource data}'/>     </Grid.Resources>     <StackPanel>         <ListBox ItemsSource='{Binding Source={StaticResource cvsData}}'/>         <TextBlock Text='{Binding Source={StaticResource cvsData}, Path=Length, StringFormat='{}Length bound to current String = {0}'}'/>         <TextBlock Text='{Binding Source={StaticResource cvsData}, Path=SourceCollection.Length, StringFormat='{}Length bound to source array = {0}'}'/>     </StackPanel> </Grid> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 61k
  • Answers 61k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I take it you want to scan through another's process… May 11, 2026 at 9:51 am
  • added an answer I have used both Phing and Ant and prefer the… May 11, 2026 at 9:51 am
  • added an answer Look into the new Java concurrency facilities (in the java.util.concurrent… May 11, 2026 at 9:51 am

Related Questions

I currently have a collection with a HasChanges property on it (each object in
I am currently faced with a difficult sorting problem. I have a collection of
I currently have a fairly robust server-side validation system in place, but I'm looking
I currently have a class and I'm trying to create an easy GUI to
I currently have a functioning in-house Windows Forms application which extensively uses the DataGridView
I currently have a DetailsView in ASP.NET that gets data from the database based
I currently have a couple of SVN repositories hosted at Unfuddle and I'd like
I currently have a list view which has several rows of data and I
I currently have a listview and I want to add an appropriate icon to
I currently have a source control folder in TFS with all of my source

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.