Repository navigation
Closed
Labels
hacktoberfestComplete the Hacktoberfest challenge and earn something special each year.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugSomething isn't workingproject/styling 👔Categorizes an issue or PR as relevant to element styling
Description
Current behavior
if I declare a style as
<Style x:Key="MaterialDesignRaisedButton" TargetType="Button" BasedOn="{x:Null}">the solution fails to compile because it generates this code:
public static global::Windows.UI.Xaml.Style MaterialDesignRaisedButton
{
get
{
if(!_MaterialDesignRaisedButtonInitialized)
{
__MaterialDesignRaisedButtonBackingField =
new global::Windows.UI.Xaml.Style(typeof(global::Windows.UI.Xaml.Controls.Button))
{
BasedOn = (global::Windows.UI.Xaml.Style)#Error // NullExtension could not be found.,
Setters =
{
}
}
;
_MaterialDesignRaisedButtonInitialized = true;
}
return __MaterialDesignRaisedButtonBackingField;
}
}Expected behavior
I'm not sure if setting BasedOn to null is equivalent to not generate the setting code at all. What I'm sure is that it should compile.
Environment
Affected platform(s):
- iOS
- Android
- WebAssembly
- WebAssembly renderers for Xamarin.Forms
- macOS
- Windows
- Build tasks
- Solution Templates
Metadata
Metadata
Assignees
Labels
hacktoberfestComplete the Hacktoberfest challenge and earn something special each year.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugSomething isn't workingproject/styling 👔Categorizes an issue or PR as relevant to element styling
Activity
jeromelaban commentedon Jan 14, 2020
/cc @davidjohnoliver this should be adressed as part of the Styles work #119 and #1766
davidjohnoliver commentedon Sep 25, 2020
Guidance for contributors: this one will involve making modifications to the XamlFileGenerator class. You can enable debugging and source-method annotation in the
XamlCodeGenerationclass.Don't forget to add a unit test in
Uno.UI.Tests. :)kazo0 commentedon Oct 2, 2020
Is this issue still a thing now that the Styles work that Jerome mentioned is done?
davidjohnoliver commentedon Oct 5, 2020
@kazo0 It's probably still happening, it most likely requires a special case for the Xaml generation that was left out of the Styles work. But test it out in a blank app and see, maybe it works :)