Version

Washing Color Schemes (xamSchedule)

Topic Overview

Purpose

This topic explains how to change the colors of the xamSchedule’s color schemes.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic provides an overview of the xamSchedule control.

This topic describes how to create custom color schemes for the xamSchedule .

Introduction

Introduction to color washing

You can use the Resource Washer to wash the xamSchedule’s color schemes with a specific color, which will change the look and feel of your application completely.

Note
Note

The xamSchedule control’s user interface is comprised of several Ultimate UI for WPF controls ( xamCalendar, xamMenu and xamRibbon , which of these controls are available to xamSchedule depends on what functions you are using (for example, you might be using “lightweight” or “full-featured” dialogs). Consequently, if you want to make the whole user interface consistent you may need to wash the other controls too.

XamSchedule color scheme washing procedure

Introduction

Given that the Resource Washer is itself a ResourceDictionary, you should add it to your application or page resources. You can wash both an existing or custom color scheme.

Preview

The next two screenshots compare and contrast the xamSchedule using the standard IG color scheme and the IG color scheme washed using a Magenta color.

Standard IG color scheme applied:

xamSchedule Washing1.png

IG color scheme washed with Magenta color applied:

xamSchedule Washing2.png

Steps

The following steps-by-step instructions demonstrate the basic procedure you are required to perform in order to wash a xamSchedule’s color scheme. For more information, please refer to the following code examples.

  1. Create a ResourceWasher

Instantiates an instance of ResourceWasher in either XAML or code.

  1. Configure the ResourceWasher

Configures the ResourceWasher for your specific needs (for example, set the WashColor and the SourceDictionary properties). Please read the ResourceWasher’s topics for additional information on how to use it.

  1. Add the ResourceWasher in the Resources

Adds the ResourceWasher to your Application or Page’s resources.

Code Examples

Code examples summary

The following table lists the code examples included in this topic.

Example Description

This code example demonstrates how to wash color schemes in XAML

This code example demonstrates how to wash color schemes in C#

This code example demonstrates how to wash color schemes in VB

Washing Color Schemes in XAML – Code Example

Description

This code example demonstrates how to wash color schemes in XAML.

Code

In XAML:

<Page
  x:Class="IGSchedule.Samples.MyPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  mc:Ignorable="d"
  ...
  xmlns:ig="http://schemas.infragistics.com/xaml"
  xmlns:igThemes="http://infragistics.com/Themes" >
  <Page.Resources>
    <ig Themes :ResourceWasher WashColor="Magenta">
      <ig Themes :ResourceWasher.SourceDictionary>
        <ResourceDictionary>
          <Style TargetType="ig:XamScheduleDataManager">
            <Setter Property="ColorScheme">
              <Setter.Value>
                <ig:IGColorScheme />
              </Setter.Value>
            </Setter>
          </Style>
        </ResourceDictionary>
      </ig Themes :ResourceWasher.SourceDictionary>
    </ig Themes :ResourceWasher>
  </Page.Resources>
  <ig:XamDayView x:Name="dayView" ... />
</Page>

Washing Color Schemes in C# – Code Example

Description

This code example demonstrates how to wash color schemes in C#.

Code

In C#:

// create an instance of the IG color scheme
IGColorScheme igcs = new IGColorScheme();
// create new style, which will set the "ColorScheme"
// of the xamSchedule's data manager and the value
// will be the IG color scheme instance we've created above
System.Windows.Style style = new System.Windows.Style();
style.TargetType = typeof(XamScheduleDataManager);
style.Setters.Add(new Setter()
{
    Property = XamScheduleDataManager.ColorSchemeProperty,
    Value = igcs
});
// add this style in the merged dictionaries of a
// ResourceDictionary, which is set as in the
// "SourceDictionary" property of the Resource Washer
ResourceDictionary rd = new ResourceDictionary();
rd.Add("style1", style);
ResourceWasher rw = new ResourceWasher();
rw.SourceDictionary = rd;
// set the color you want to wash the color scheme with
rw.WashColor = Colors.Magenta;
// set the washed color scheme to the xamSchedule's data manager
this.dataManager.ColorScheme = igcs;

Washing Color Schemes in Visual Basic – Code Example

Description

This code example demonstrates how to wash color schemes in VB.

Code

In Visual Basic:

' create an instance of the IG color scheme
Dim igcs As New IGColorScheme()
' create new style, which will set the "ColorScheme"
' of the xamSchedule's data manager and the value
' will be the IG color scheme instance we've created above
Dim style As New System.Windows.Style()
style.TargetType = GetType(XamScheduleDataManager)
style.Setters.Add(New Setter() With { _
      .[Property] = XamScheduleDataManager.ColorSchemeProperty, _
      .Value = igcs _
})
' add this style in the merged dictionaries of a
' ResourceDictionary, which is set as in the
' "SourceDictionary" property of the Resource Washer
Dim rd As New ResourceDictionary()
rd.Add("style1", style)
Dim rw As New ResourceWasher()
rw.SourceDictionary = rd
' set the color you want to wash the color scheme with
rw.WashColor = Colors.Magenta
' set the washed color scheme to the xamSchedule's data manager
Me.dataManager.ColorScheme = igcs

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic introduces you to the Resource Washer.

This topic introduces you to the Resource Washer component where you learn to change the overall color schemes of your applications.

Explains the creation of xamSchedule’s Custom Color Schemes.