Tricky one to explain, so here’s an example:
PillButton.ux
<DockPanel ux:Class="PillButton">
<Rectangle Layer="Background" CornerRadius="25">
<SolidColor ux:Name="pillBackgroundColour" Color="#fff"/>
<Stroke Width="1" ux:Name="pillOutlinecolour" Brush="#ccc"/>
</Rectangle>
</DockPanel>
<Text ux:Class="PillButtonText" TextColor="#fff" FontSize="12" Margin="7,3" />
PageStyles.ux
<!-- Page 1 is red, so give it a red pill style -->
<Style ux:Class="Page1Style">
<PillButton>
<SolidColor ux:Name="pillBackgroundColour" Color="#f00"/>
<Stroke Width="1" ux:Name="pillOutlinecolour" Brush="#f00"/>
</PillButton>
<!-- Yellow text because yellow, amirite? -->
<!-- also, yes, I know, this is wrong. It's pseudo-code. :) -->
<Set PillButtonText TextColor="#ff0" />
</Style>
<!-- Page 2 is blue, so give it a blue pill style -->
<Style ux:Class="Page2Style">
<PillButton>
<SolidColor ux:Name="pillBackgroundColour" Color="#00f"/>
<!-- yellow outline, because yellow. -->
<Stroke Width="1" ux:Name="pillOutlinecolour" Brush="#ff0"/>
</PillButton>
<!-- Green text. -->
<Set PillButtonText TextColor="#0f0" />
</Style>
MainView.ux
<PageControl>
<Page1Style>
<Page ux:Name="page1">
<PillButton>
<PillButtonText Value="This is yellow text, on red background" />
</PillButton>
</Page>
</Page1Style>
<Page2Style>
<Page ux:Name="page2">
<PillButton>
<PillButtonText Value="This is green text, on blue background, with a yellow outline around the pill" />
</PillButton>
</Page>
</Page2Style>
</PageControl>
I’m sure I’m missing something simple here, as I’ve only just started with Fuse, but is this sort of thing even possible at the moment? My aim is to use a CSS-style approach, so as not to redefine entire structures just to change the colour scheme of inner elements.
Cheers, Dan