microsoft / microsoft/WPF-Samples

DependencyProperty with collection properties

Open
#346 3 comments 2 reactions 1 assignee View on GitHub

@anjaligupta-dev is already working on this.

Since Dec 15, 2023.

waiting-author-feedback
Dominant language
C#
Stars
5.7k
Forks
3.3k
Avg merge
12d 8h
Merged PRs (30d)
2

Description

CA2227 is raised when DependencyProperty is used with collection type.

public IList<short> SampleXStart
{
    get { return (IList<short>)GetValue(SampleXStartProperty); }
    set { SetValue(SampleXStartProperty, value); }
}

public static readonly DependencyProperty SampleXStartProperty =
    DependencyProperty.Register(nameof(SampleXStart), typeof(IList<short>), typeof(Scan), new PropertyMetadata(Array.Empty<short>()));

Can anyone suggest how to deal with it? The sample code doesn't contain any DependencyPropertys with a collection type

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.