-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
WPF-style styles #2765
Comments
Assigning the default style to a control On the low level it would interface IHaveDefaultStyle
{
Style GetDefaultStyle();
} implemented by the control. From user point of view it would be a XAML file looking like this in the same assembly as the control <Style x:DefaultStyleFor="{x:Type MyControl}">
</Style> It would be wired into MyControl via IHaveDefaultStyle implementation generated by the XAML compiler |
Since our xaml loader depends on <Style x:Class="Avalonia.Markup.Xaml.DefaultStyles.DefaultButtonStyle" TargetType="x:Type Button"> internal class DefaultButtonStyle : Style
{
} it should allow us to reference such styles from C# code like this: new Dictionary<Type, Style>
{
[typeof(Button)]= new DefaultButtonStyle();
} which could be used to resolve styles for controls from |
I spoke about a way to specify default themes here: #1883 How does this compare? |
Superseded by #2769 |
Basically we need a way for controls to have their own styles that would provide the control theme.
If there is no Style manually specified and no Style found in Resources, the system should use the default style for such control.
"Own" styles should work alongside with our current resource system, it should be possible to set the own style using a css style, e. g.
This feature will
StyleInclude
for every 3rd party libraryThe text was updated successfully, but these errors were encountered: