How to set label color of livechart? - wpf

I have an application based on materialdesigninxaml framework where I can set the light and the dark color, when the light color is setted I can see correctly the label text which is black, but when I set the dark theme the label of the charts still remain black, so I don't see anything. This is my chart:
<lvc:CartesianChart Series="{Binding}" LegendLocation="Bottom">
<lvc:CartesianChart.AxisY>
<lvc:Axis Labels="{Binding AnalysisController.Labels}"/>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
I tried to add this to my App.xaml as suggested by the documentation:
<ResourceDictionary Source="pack://application:,,,/LiveCharts.Wpf;component/Themes/Colors/white.xaml" />
but the color of the text is still black

You can set the Foreground of your axis to another color like this:
<lvc:CartesianChart Series="{Binding}" LegendLocation="Bottom">
<lvc:CartesianChart.AxisY>
<lvc:Axis Labels="{Binding AnalysisController.Labels}"
Foreground="White"/>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>

Related

Find MahApps Metro title bar color

I am using MahApps Metro and i'm trying to get to TitleBar color to use it with other controllers:
In App.xaml file all i can see is:
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
Which is the theme name, i can change BaseLight to Red for exapmle and my TitleBar become Red but i really like this color.
Any suggestions how to find this color ?
It should be
AccentColorBrush
You can access it like this:
<TextBox Background="{DynamicResource AccentColorBrush}" />

What is the default background color for a TabItem?

I'm attempting to match another element to the TabItem and need the color or SystemColor.
Here's the default TabControl and TabItem template which shows the colors:
http://msdn.microsoft.com/en-us/library/cc645035(v=vs.95).aspx
To ensure you match the exact color with minimal effort, you could simply use a binding:
<MyControl Background="{Binding ElementName=MyTabElement, Path=Background}" />

How to add Margin to DevExpress WPF Controls?

DevExpress WPF is driving me mad with things that are very simple.
How do I add margin around a control in DevExpress WPF?
For default WPF control, I can simply add a "Margin" property in control, for example:
<Button Margin="5" />
Done. In DevExpress WPF, there is no Margin property. Take following code as an example - a ComboBox - how do I add Margin to it?
<dxb:BarEditItem x:Name="comboBox" Content="ComboBox" EditWidth="100" EditHeight="35">
<dxb:BarEditItem.EditSettings>
<dxe:ComboBoxEditSettings>
<dxe:ComboBoxEditSettings.Items>
<dxe:ComboBoxEditItem>AAA</dxe:ComboBoxEditItem>
<dxe:ComboBoxEditItem>BBB</dxe:ComboBoxEditItem>
<dxe:ComboBoxEditItem>CCC</dxe:ComboBoxEditItem>
</dxe:ComboBoxEditSettings.Items>
</dxe:ComboBoxEditSettings>
</dxb:BarEditItem.EditSettings>
</dxb:BarEditItem>
A bar item is a non-visual object that implements a specific functionality so you can't apply visual properties on it directly.
You can set the editor properties via the BarEditItem.EditStyle property:
<dxb:BarEditItem x:Name="comboBox" Content="ComboBox" EditWidth="100">
<dxb:BarEditItem.EditStyle>
<Style TargetType="dxe:ComboBoxEdit">
<Setter Property="Margin" Value="12,4,12,4"/>
</Style>
</dxb:BarEditItem.EditStyle>
<dxb:BarEditItem.EditSettings>
<dxe:ComboBoxEditSettings>
<dxe:ComboBoxEditSettings.Items>
<dxe:ComboBoxEditItem>AAA</dxe:ComboBoxEditItem>
<dxe:ComboBoxEditItem>BBB</dxe:ComboBoxEditItem>
<dxe:ComboBoxEditItem>CCC</dxe:ComboBoxEditItem>
</dxe:ComboBoxEditSettings.Items>
</dxe:ComboBoxEditSettings>
</dxb:BarEditItem.EditSettings>
</dxb:BarEditItem>

Silverlight RichTextBox does not pick up background

I have a popup window like this,
<controls:ChildWindow Background="Aquamarine">
<RichTextBox>
<Paragraph x:Name="WarningMessage" >
<Run>Test 1234</Run>
</Paragraph>
</RichTextBox>
</controls:ChildWindow>
I've removed most of the xaml for clarity, but the problem is that I have set the child window to have a background of Aquamarine, but the rich text box control still has a white background.
Is there any way to make the rich text control use the colour of the parent control?
RichTextBox's template defines default background as white. To change it you have to set Background property of the RichTextBox to different color. In your case "Transparent" color will do the trick.
<RichTextBox Background="Transparent">
...

How to change the Fluent Ribbon UI backstage color

How do I change the color of the Fluent Ribbon UI backstage menu which is – by default – blue?
You need to set the Backstage Background Color. This will update the MenuButton, BackstageTabItems and the swish in the corner of the backstage panel. Example below sets the color to Red.
<Fluent:Backstage Background="Red">
<Fluent:BackstageTabControl>
<Fluent:BackstageTabItem Header="New"/>
<Fluent:BackstageTabItem Header="Print"/>
</Fluent:BackstageTabControl>
</Fluent:Backstage>
Version 3.4.0: you can change the ribbon theme color using the MetroColors.ThemeColorKey property.
Put the following code in App.xaml file:
<Application.Resources>
<ResourceDictionary>
<!-- This "override" is needed to change the ribbon theme color, do not remove! -->
<Color x:Key="{x:Static fluent:MetroColors.ThemeColorKey}">#FFF66AC1</Color>
...
UPDATE
With Fluent.Ribbon version 9.0.4 only the MenuButton is updated when setting the Backstage Background property.
To update the BackstageTabControl ItemsPanel you have to set the BackstageTabControl ItemsPanelBackground property.
You can also set the BackstageTabControl Background which is also not updated wile setting the Backstage Background property.
<Fluent:Backstage Header="myHeader" Background="Red">
<Fluent:BackstageTabControl ItemsPanelBackground="Red" Background="Red">
<Fluent:Button Header="Preferences" Command="{Binding OpenPreferencesCommand}" />
<Fluent:BackstageTabItem Header="Print" />
<Fluent:Button Header="Blue" />
</Fluent:BackstageTabControl>
</Fluent:Backstage>

Resources