Skip to content

PropertyMetadata has wrong name in RegisterAttached #11754

Closed

Description

@dansiegel

Current behavior

When compiling for NetStandard the PropertyMetadata argument in DependencyProperty.RegisterAttached is typeMetadata. When compiling for all other platforms it is defaultMetadata.

Expected behavior

The argument should be named consistent with the other platforms defaultMetadata

How to reproduce it (as minimally and precisely as possible)

	public static readonly DependencyProperty FooProperty =
		DependencyProperty.RegisterAttached(
			name: "Foo",
			propertyType: typeof(string),
			ownerType: typeof(MyClass),
#if NETSTANDARD
			typeMetadata: new PropertyMetadata(defaultValue: null, propertyChangedCallback: OnFooChanged));
#else
			defaultMetadata: new PropertyMetadata(defaultValue: null, propertyChangedCallback: OnFooChanged));
#endif

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

WebAssembly, Skia (WPF), Skia (GTK on Linux/macOS/Windows), Skia (Linux Framebuffer)

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    kind/bug
    triage/untriaged
    difficulty/tbd
    on Mar 21, 2023
  2. Youssef1313 commented on Mar 21, 2023

    @Youssef1313
    Member

    The name appears to be typeMetadata in all Uno targets?

    public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType, PropertyMetadata typeMetadata)

    The name defaultMetadata is from Windows. We should change the name to match Windows, but likely as a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/tbdkind/bugtriage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions