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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:18:25+00:00 2026-05-22T21:18:25+00:00

I have a custom Silverlight (4) control, not unlike a datagrid. This control has

  • 0

I have a custom Silverlight (4) control, not unlike a datagrid. This control has a property called ColumnConfiguration. When using this control in a Navigation application, the ColumnConfiguration has its items added again (through XAML), while retaining it’s old columns, the result is that twice the normal amount of columns are added to the control.

public ColumnCollection ColumnConfiguration
{
    get { return (ColumnCollection)GetValue(ColumnConfigurationProperty); }
    set { SetValue(ColumnConfigurationProperty, value); }
}

public class ColumnCollection : Collection<ColumnBase> { }

How can i prevent these columns being added to the control again?

Xaml is like this:

<my:Control.ColumnConfiguration>
<my:ColumnTypeA Width="*" MinWidth="50">
</my:ColumnTypeA>
<my:ColumnTypeB Width="2*" MinWidth="50">

</my:ColumnTypeB>
<my:ColumnTypeB Width="2*" MinWidth="50">

</my:ColumnTypeB>
<my:ColumnTypeB Width="*" MinWidth="50">

</my:ColumnTypeB>
<my:ColumnTypeB Width="2*" MinWidth="50">

</my:ColumnTypeB>
</my:Control.ColumnConfiguration>
  • 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-22T21:18:26+00:00Added an answer on May 22, 2026 at 9:18 pm

    Could it be that you supplied a default value in the DependencyProperty UIPropertyMetaData? As the DependencyProperty is static, the default value specified there will be the same (reference) for all instances of your control. This is harmless when using value types, but when your property is a reference type, you will have to set its initial value using the .ctor() of your control (or any other instance-way) in order to create individual initial values.

    I suppose you have this control twice instantiated in your application, supposedly using MVVM DataTemplate? The first instance will add columns to the static ColumnCollection created using the default value and the secod will also use this very instance again.

    You could verify this by looking at the default ToString() value of your ColumnCollection, it will contain a hash value for the reference.

    To resolve, simply set the default value for the ColumnConfigurationProperty to null.

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

Sidebar

Related Questions

I have a Silverlight 3 tools library with a custom DataGrid user control. This
We have custom headers in the Silverlight DataGrid using the ContentTemplate. We've got a
I'm using the Silverlight 3 datagrid and have a number of custom styles applied
I have a custom control in Silverlight, the change of property via property window
I have a Silverlight custom control with two properties; Text and Id. I have
I have a custom base user control in silverlight. <UserControl x:Class=Problemo.MyBaseControl 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
I have a Silverlight app with a DataGrid containing some custom columns and all
I am trying to use the Sharp-shooter Silverlight report viewer control. This control has
I have a style template (below) that does not update some my custom control
I have written a custom Silverlight control based on Control. I have two DependencyProperties

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.