My class constructor creates and adds the resources.
I would also add resources from xaml but it seems that the xaml completely replace the object resources.
public BasePage ()
{
if (this.Resources == null) this.Resources = new ResourceDictionary ();
// Specific style
var menubuttonstyle = new Style (typeof(Button)) {
Setters = {
new Setter { Property = Button.TextColorProperty, Value = Color.FromHex("0a4cf1")},
new Setter { Property = Button.FontSizeProperty, Value = 27 },
new Setter { Property = Button.BackgroundColorProperty, Value = Color.FromHex("ffffff")}
}
};
this.Resources.Add ("MenuButton",menubuttonstyle);
}
The Xaml:
<local:BasePage.Resources>
<ResourceDictionary>
<local:InverterConverter x:Key="inverterConverter" />
</ResourceDictionary>
</local:BasePage.Resources>
<Button Text="{Binding btNuovoOrdine_Text}" Grid.Row="0" Grid.Column="0" Style="{StaticResource MenuButton}" Clicked="Funzione1Clicked"/>
The Style menubutton has been removed.
Is there a way to do it?
Thanks.