Skip to content

Should we adopt consistent syntax for TypeArguments and Type too? #25231

Open
@suugbut

Description

@suugbut

Description

<DataTemplate x:DataType="x:String"> <!-- OK -->
<DataTemplate x:DataType="{x:Type x:String}"> <!-- OK -->

<Style TargetType="Button"> <!-- OK -->
<Style TargetType="{x:Type Button}"> <!-- OK -->

Rote memorizing the exceptions below can definitely be exhausting.

<OnPlatform x:TypeArguments="x:Double"> <!-- OK -->
<OnPlatform x:TypeArguments="{x:Type x:Double}"> <!-- Error -->

<x:Array  Type="x:Double"> <!-- Error -->
<x:Array  Type="{x:Type x:Double}"> <!-- OK -->

<Foo Bar="{Binding Source={RelativeSource AncestorType={x:Type Bazz}}}"/> <!-- OK -->
<Foo Bar="{Binding Source={RelativeSource AncestorType='Bazz'}}"/> <!-- Error -->

Public API Changes

Remove the restriction and free us from memorizing unnecessary things.

Intended Use-Case

So I think the following syntax should be acceptable or valid. What do you think?

<OnPlatform x:TypeArguments="{x:Type x:Double}"> <!-- Should it be allowed as well? -->

<x:Array  Type="x:Double"> <!-- Should it be allowed as well? -->

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions