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 8963481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:21:56+00:00 2026-06-15T16:21:56+00:00

I have a class (let’s call it externalClass ) with a ObservableCollection<Point> channel1 inside.

  • 0

I have a class (let’s call it externalClass) with a ObservableCollection<Point> channel1 inside. (the class itself does NOT implements INotify)

In the MainWindow I have a polyline binded to this externalClass.channel1 that uses a converter from ObservableCollection to PointCollection.

So from the C# I bind DataContext = externalClass; and in the XAML the polyline looks like:

<Polyline Points="{Binding channel1, Converter={StaticResource pointCollectionConverter}}" Stroke="#FF00E100" Name="line" />

I have a test function that works like that:

public void test()
{
   ObservableCollection<Point> newone = new ObservableCollection<Point>();
   for (int i = 0; i < debugCh1.Count; i++)
   {
      Point p1 = debugCh1[i];
      p1.Y = p1.Y + 1;
      newone.Add(p1);
   }
   channel1= newone;
}

If I add a breakpoint in the converter itself I can see that on start-up it is called (and actually the initial values (hard-coded) are displayed. But when I add the test function to a button .. it does nothing (the converter is not called)

Any idea idea of where the notification of the changes is being stopped ???

SOLUTION

After reading the answers and googleling a bit more I came out with the soulition. Id like to post it there for everybody else

So .. The so-called externalClass must inherit from INotifyPropertyChanged and it must implement NotifyPropertyChanged
So all and all it must be declared like that:

public class externalClass  : INotifyPropertyChanged
{ 
  ....
    // at some point you have your ObservableCollection<smth> as a property 
    public ObservableCollection<Point> channel1 { get; set; }
  ....
    //at some point you implement NotifyPropertyChanged
    public event PropertyChangedEventHandler PropertyChanged;
    private void NotifyPropertyChanged(string caller)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(caller));
        }
    }
   ....
   //then whenever you need to fire the notification
   [..]do something with channel1
   NotifyPropertyChanged("channel1");

And that’s all. If you add a proper binding (as the one I showed in my question) the whole set up is gonna work.. At least mine worked hehehe

Good luck! And thanks to the people that helped me !! 😀

  • 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-15T16:21:57+00:00Added an answer on June 15, 2026 at 4:21 pm

    Polyline Points probably does not listen to INotifyCollectionChanged when bound. Try exposing Channel1 as a property and raise the INotifyPropertyChanged with "Channel1"

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

Sidebar

Related Questions

Let's say I have: class myClass std::list<myClass> myList where myClass does not define the
I have a class (let's call it myClass ) that implements both __hash__ and
In Visual Studio 2008 (C++) I have a class destructor (Let's call this class
I have created a separate class (let's call it class2.cs for example) and want
I have a non-Activity class (let's call it NonActivity) that needs to post a
I currently have a need for a custom ListViewItem class - let's call it
let say i have following class: class Shape { public int widht; public List<Point>
i have a class let's call it cell, .cms-block .cell{ width:520px; float:left;} .cms-block.wide .cell{width:
Not sure how to implement this scenario: I have a base class let's say
let say we have class Person($name), Does $name need to be asigned as null

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.