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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:40:17+00:00 2026-06-15T01:40:17+00:00

My current implementation doesn’t show anything on the form even though the collections I

  • 0

My current implementation doesn’t show anything on the form even though the collections I thought bounded have data (I checked in debug).

Here’s some code:

    public event PropertyChangedEventHandler PropertyChanged;
    PointCollection imagePoints;
    public PointCollection ImagePoints
    {
        get
        {
            return this.imagePoints;
        }
        set
        {
            if (this.imagePoints != value)
            {
                this.imagePoints = value;
                if (this.PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("ImagePoints"));
                }
            }
        }
    }

and the corresponding xaml:

<Polygon x:Name="imagePolygon" Points="{Binding ImagePoints}" Stretch="Fill" Fill="Black" Opacity="0.8" />

Now, I did all the binding by writing the code. In this example, it works just fine, yet in mine, the points don’t show up on the polygon.

Any pearls of wisdom?

Edit:here’s the complete xaml code

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="WpfApplication2.HistogramWindow"
    Title="HistogramWindow" Height="436" Width="604">
<Grid>
    <TabControl HorizontalAlignment="Left" Height="406" VerticalAlignment="Top" Width="596" >
        <TabItem x:Name="imageTab" Header="Full Image" Height="23" VerticalAlignment="Top">
            <Border BorderBrush="Black" BorderThickness="1" Margin="10">
                <Polygon x:Name="imagePolygon" Points="{Binding ImagePoints}" Stretch="Fill" Fill="Black" Opacity="0.8" />
            </Border>
        </TabItem>
        <TabItem x:Name="boneTab" Header="Bone">
            <Border BorderBrush="Black" BorderThickness="1" Margin="10">
                <Border.BindingGroup>
                    <BindingGroup/>
                </Border.BindingGroup>
                <Polygon x:Name="bonePolygon" Points="{Binding BonePoints}" Stretch="Fill" Fill="Black" Opacity="0.8" >

                </Polygon>
            </Border>
        </TabItem>
        <TabItem x:Name="fatTab" Header="Fat" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top" Width="57">
            <Border BorderBrush="Black" BorderThickness="1" Margin="10">
                <Polygon x:Name="fatPolygon" Points="{Binding FatPoints}" Stretch="Fill" Fill="Black" Opacity="0.8" />
            </Border>
        </TabItem>
    </TabControl>

</Grid>

Edit: After a modification of the config file, I find this in the output window:

System.Windows.Data Information: 41 : BindingExpression path error: 'ImagePoints'   property not found for 'object' because data item is null.  This could happen because the data provider has not produced any data yet. BindingExpression:Path=ImagePoints; DataItem=null; target element is 'Polygon' (Name='imagePolygon'); target property is 'Points' (type 'PointCollection')
System.Windows.Data Information: 20 : BindingExpression cannot retrieve value due to missing information. BindingExpression:Path=ImagePoints; DataItem=null; target element is 'Polygon' (Name='imagePolygon'); target property is 'Points' (type 'PointCollection')
System.Windows.Data Information: 21 : BindingExpression cannot retrieve value from null data item. This could happen when binding is detached or when binding to a Nullable type that has no value. BindingExpression:Path=ImagePoints; DataItem=null; target element is 'Polygon' (Name='imagePolygon'); target property is 'Points' (type 'PointCollection')
System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=ImagePoints; DataItem=null; target element is 'Polygon' (Name='imagePolygon'); target property is 'Points' (type 'PointCollection')
  • 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-15T01:40:18+00:00Added an answer on June 15, 2026 at 1:40 am

    I’m not sure why you are getting binding errors, but on first sight the code you have looks fine.

    I have written a small piece of code that works, so you can check that out and see if you have missed something. I guess it must be kinda similar to yours..

    Relevant part of the XAML:

    <TabItem x:Name="imageTab" Header="Full Image" Height="23" VerticalAlignment="Top">
        <Border BorderBrush="Black" BorderThickness="1" Margin="10">
            <StackPanel>
                <Polygon x:Name="imagePolygon" Points="{Binding ImagePoints}" Stretch="Fill" Fill="Black" Opacity="0.8" />
                <Button Content="Set new points" Click="btnSetNew" />
            </StackPanel>
        </Border>
    </TabItem>
    

    Code-behind for the window:

    public partial class Window1 : Window, INotifyPropertyChanged
    {
        public Window1()
        {
            InitializeComponent();
    
            this.ImagePoints = new PointCollection
                (new [] { new Point(1, 2), new Point(34, 12), new Point(12, 99) });
    
            //Important - maybe you missed this?
            this.DataContext = this;
        }
    
        public event PropertyChangedEventHandler PropertyChanged;
        PointCollection imagePoints;
        public PointCollection ImagePoints
        {
            get
            {
                return this.imagePoints;
            }
            set
            {
                if (this.imagePoints != value)
                {
                    this.imagePoints = value;
                    if (this.PropertyChanged != null)
                    {
                        PropertyChanged(this, new PropertyChangedEventArgs("ImagePoints"));
                    }
                }
            }
        }
    
        private void btnSetNew(object sender, RoutedEventArgs e)
        {
            this.ImagePoints = new PointCollection(
                new[] { new Point(23, 2), new Point(12, 556), new Point(4, 89) });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Paramiko's SFTPClient apparently does not have an exists method. This is my current implementation:
I have been reviewing the setup of a current Amazon Web Store implementation to
My current implementation of an Hash Table is using Linear Probing and now I
I want to replace the bitshift bool overload for i/ostream. The current implementation only
I read that with .NET Framework 4 the current garbage collection implementation is replaced:
There is a custom implementation of KSPA which needs to be re-written. The current
I'm using Autofac and want to resolve the correct implementation of the current assembly
Current requirement is on button click I am getting a json data through ajax
Current Process: I have a tar.gz file. (Actually, I have about 2000 of them,
I have a problem with the Google App Engine JDO implementation that I cannot

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.