Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Make Setter.Value the ContentProperty for Setter #62

Open
Felix-Dev opened this issue Dec 10, 2018 · 3 comments
Open

Proposal: Make Setter.Value the ContentProperty for Setter #62

Felix-Dev opened this issue Dec 10, 2018 · 3 comments
Labels
area-VSM feature proposal New feature proposal needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) product-winui3 WinUI 3 issues team-Markup Issue for the Markup team wct

Comments

@Felix-Dev
Copy link
Contributor

A reference to the following issue posted in the WPF repository: dotnet/wpf#84

For convenience, here is the original suggestion by @thomaslevesque:

Currently, when you want to set the value of a setter to a complex object (e.g. control template), you have to specify the <Setter.Value> element:

<Style TargetType="Button">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">
                ...
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

But this element brings no value at all, it just adds noise. Making Value the ContentProperty for Setter would make the code a bit less verbose:

<Style TargetType="Button">
    <Setter Property="Template">
        <ControlTemplate TargetType="Button">
            ...
        </ControlTemplate>
    </Setter>
</Style>

Certainly, in my opinion, one of those small changes which will make XAML programming more convenient.

@jevansaks
Copy link
Member

jevansaks commented Dec 11, 2018

Great feedback! I've filed an internal issue on the parser team for tracking.

@jevansaks jevansaks added the feature proposal New feature proposal label Dec 11, 2018
@kikisaints kikisaints added the needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) label Aug 2, 2019
@kikisaints kikisaints removed their assignment Aug 2, 2019
@jevansaks jevansaks added the team-Markup Issue for the Markup team label Nov 7, 2019
@Felix-Dev Felix-Dev changed the title Simplification: Make Setter.Value the ContentProperty for Setter Proposal: Make Setter.Value the ContentProperty for Setter Dec 6, 2019
@michael-hawker
Copy link
Collaborator

Is there more required here beyond just setting the ContentProperty attribute built-in to the framework?

@evelynwu-msft evelynwu-msft added the product-winui3 WinUI 3 issues label Oct 17, 2022
@evelynwu-msft
Copy link
Contributor

Is there more required here beyond just setting the ContentProperty attribute built-in to the framework?

Probably not; I don't recall Setter.Value being a property that we do tricky things with under the cover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VSM feature proposal New feature proposal needs-winui-3 Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3) product-winui3 WinUI 3 issues team-Markup Issue for the Markup team wct
Projects
None yet
Development

No branches or pull requests

5 participants