dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.89k stars 1.69k forks source link

Enable the ability to include default styles alongside Maui Controls #6350

Open PureWeen opened 2 years ago

PureWeen commented 2 years ago

Currently there's not a reasonable way to package default styles inside Controls. If we try to add our own DefaultDictionary into Merged Dictionary it gets cleared out after InitalizeComponent is called.

At a later point I'll elaborate on the spec here but the ideal end goal here would be

https://github.com/dotnet/maui/pull/6255

SchreinerK commented 2 years ago

does v7 then include something like the assignment of the default style in WPF?

static CustomControl() {
    DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl), new FrameworkPropertyMetadata(typeof(CustomControl)));
}

or is there another way to create custom control libraries?

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

Alex-Dobrynin commented 1 year ago

+1 UP

japarson commented 9 months ago

@StephaneDelcroix FYI running into this issue when trying to convert a WPF LPE unit test to work for MAUI.