Skip to content

Collection-Type dependency problems #3

@brunomnsilva

Description

@brunomnsilva

For whom it may concern, if you use the CRUD control within other usercontrols (ui pages) that may get created several times, you may stumble across this problem: the Columns and SortingProperties dependency properties collections seem to "be set twice" (i.e., accumulate the values obtained from the data templates). This will turn the control unusable in such setting.

However, the fix is simple:

public GenericCrudControl()
{
SetValue(SortingPropertiesProperty, new ObservableCollection());
SetValue(ColumnsProperty, new ObservableCollection());

        InitializeComponent();            
    }

I spent hours on this, until I stumbled upon:

https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/collection-type-dependency-properties

Nice work, although! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions