Topic Author
Posts: 2
Joined: 02 Oct 2015, 08:49

Control Colors

20 Oct 2015, 11:44


I am using trial version Of Noesis GUI 1.24 package . In unity 5.2.1

Here I am trying to change the Noesis Controls (color), Suppose if there is check Box, in it Check Mark is Blue I want To Change it red how can i Change it , I want to change all control colors as per requirement.

Can anybody help me to sort out this problem. :roll: :roll: :roll:
User avatar
Site Admin
Posts: 2329
Joined: 22 Dec 2011, 19:20

Re: Control Colors

20 Oct 2015, 13:06

Control appearance is specified by its Template property, where a ControlTemplate defines the tree of visual elements that are shown for a type of control.

For example, a simple CheckBox template could be:
<CheckBox Content="Some check" HorizontalAlignment="Center" VerticalAlignment="Center">
        <ControlTemplate TargetType="CheckBox">
            <Border Background="Transparent">
                        <Border x:Name="bd" BorderBrush="Black" BorderThickness="1"
                            Padding="1" Width="16" Height="16" VerticalAlignment="Center">
                            <Path x:Name="chk" Data="M0,0 L10,10 M0,10 L10,0"
                                Stroke="Red" StrokeThickness="2" Stretch="Fill"/>
                    <ContentPresenter VerticalAlignment="Center" Margin="8,0,0,0"/>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter TargetName="bd" Property="Background" Value="WhiteSmoke"/>
                <Trigger Property="IsChecked" Value="False">
                    <Setter TargetName="chk" Property="Visibility" Value="Hidden"/>
As you can see the color of each visual part is defined by the template elements. But you can bind some properties to the templated control, so changes in Control properties will modify the appearance of the template:
<CheckBox Content="Some check" HorizontalAlignment="Center" VerticalAlignment="Center"
                            <Path x:Name="chk" Data="M0,0 L10,10 M0,10 L10,0"
                                Stroke="{TemplateBinding BorderBrush}" StrokeThickness="2" Stretch="Fill"/>
The last CheckBox will have the a green check mark instead.
User avatar
Site Admin
Posts: 3204
Joined: 20 Jan 2012, 17:18

Re: Control Colors

20 Oct 2015, 18:24

By the way, all your templates can be shared in a separate XAML. There are several themes in the Unity package at Assets\NoesisGUI\Themes.

More information in the Styles and Templates Tutorial.

Who is online

Users browsing this forum: Susanna.Rowland and 0 guests