-
Notifications
You must be signed in to change notification settings - Fork 725
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
Generic.xaml
defined in the project head is not taken into account
#10327
Comments
@jeromelaban - the workaround seems just fine if you have the ' Source="Styles/Controls.xaml" ' in the .Shared project. However, I'm not sure how this works if the ResourceDictionary containing the control layouts is defined in a Uno Platform Library. Will adding a second XamlControlsResources entry pointing to a namespace in MyProject work?
Or, to I a have to add the in every project that consumes the non-shared cross platform library (but somehow referring to the referenced assembly). |
Cross platform libraries support |
Generic.xaml
defined in the project head is not taken into account
@jeromelaban I'm facing another error that I am not sure if it is related. Using an implicit style in a custom control defined in a controls library. The errors disappears if I add and use a Key. This is the Generic.xaml file: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UnoKeyboard.Controls">
<Style TargetType="local:Keyboard">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:Keyboard">
<Border x:Name="PanelRoot"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="local:Keyboard">
<Setter Property="Background"
Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="BorderBrush"
Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
</Style>
</ResourceDictionary> When I build the project that uses this control I'm getting that error several times:
|
Current behavior
Create a project with implicit styles defined in a
Generic.xaml
defined in the shared project of the heads. Use controls that use these styles.Expected behavior
The controls are styled properly
How to reproduce it (as minimally and precisely as possible)
No response
Workaround
Create another resource dictionary, named
Styles/Controls.xaml
, then reference it fromApp.xaml
:Works on UWP/WinUI
Yes
Environment
No response
NuGet package version(s)
4.6.19
Affected platforms
No response
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
Related to #10276
The text was updated successfully, but these errors were encountered: