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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:21:39+00:00 2026-05-24T10:21:39+00:00

In a Silverlight game I’m working on I’m using an ItemsControl to display an

  • 0

In a Silverlight game I’m working on I’m using an ItemsControl to display an ObservableCollection of game objects that we’ll call Foo. Foo implements INotifyPropertyChanged and has a single property: Radius. The ItemsControl‘s ItemTemplate represents each Foo as an circular path, with the radius of the path bound to Foo.Radius.

The problem I’m running into is that whenever I try to add something to the ObservableCollection I get an InvalidOperationException with the message “Operation is not valid due to the current state of the object.” If a remove the RadiusX and RadiusY bindings program runs fine, and it still works if I bind Foo.Radius to some property of Path. I’m at a loss for how to bind the geometry properties. Am I missing something?

XAML for reference:

<ItemsControl ItemsSource="{Binding}" x:Name="LayoutRoot">
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <Path Stroke="Black">
                <Path.Data>
                    <EllipseGeometry RadiusX="{Binding Radius}" RadiusY="{Binding Radius}" />
                </Path.Data>
            </Path>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

Codebehind:

private ObservableCollection<Foo> things = new ObservableCollection<Foo>();

public MainPage()
{
    InitializeComponent();
    LayoutRoot.DataContext = things;
    CompositionTarget.Rendering += Update;
}

void Update(object sender, EventArgs e)
{
    things.Add(new Foo());
}
  • 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-05-24T10:21:40+00:00Added an answer on May 24, 2026 at 10:21 am

    I did a bit more searching and discovered that in Silverlight 3 it’s only possible to bind properties to FrameworkElements, but Geometry inherits from DependencyObject. Upgrading the project to Silverlight 4 seemed to fix the problem.

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

Sidebar

Related Questions

I've been developing a Silverlight-c# client-server game that has now gotten to the point
I wonder if it is possible to build a game with flash/silverlight that has
I'm working on a Windows Phone 7 Silverlight puzzle game that is sort of
I'm working on a game that I'm developing in Silverlight, and I'm trying to
I'm working on a game using WP7 silverlight. Some controls are moving and at
I'm using VS2010,C# to develop a Silverlight online game, I use keyboard for getting
I am using VS2010,C# to develop a Silverlight web based game. I want to
I'm making a simple game using the Windows Phone Silverlight and XNA Application type
I have an XNA arcade game which runs over Silverlight environment. The game has
I am starting to develop a facebook game using ASP.NET + Silverlight Which architecture

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.