バージョン

配色のウォッシュ (xamSchedule)

トピックの概要

目的

このトピックでは、 xamSchedule の配色に関して色の変更方法を解説します。

前提条件

このトピックの本題に入る前に、以下のトピックをお読みください。

トピック 目的

このトピックでは、 xamSchedule コントロールの概要を解説します。

このトピックでは、 xamSchedule のカスタム配色の作成方法を解説します。

はじめに

カラー ウォッシュとは

ResourceWasher では、 xamSchedule の配色を指定した色でウォッシュして、ルック アンド フィールの全く異なるアプリケーションにすることができます。

注:

Note

xamSchedule コントロールのユーザー インターフェイスは、複数の Ultimate UI for WPF コントロール (xamCalendar、 xamMenu、 xamRibbon 。xamSchedule で使用できるコントロールは、使用している機能 (簡易ダイアログや 詳細ダイアログなど) など) からなります。従って、すべてのユーザー インターフェイスで統一を図るには、他のコントロールもウォッシュすることをお勧めします。

XamSchedule 配色のウォッシュ手順

はじめに

Resource Washer 自体は ResourceDictionary なので、Resource Washer はアプリケーションやページ リソースに追加します。既存の配色も、カスタム配色もウォッシュできます。

プレビュー

以下の 2 枚のスクリーンショットは、標準 IG 配色とマゼンタでウォッシュした IG 配色で xamSchedule を比較し、対比させたものです。

標準 IG 配色の場合:

xamSchedule Washing1.png

マゼンタでウォッシュした IG 配色:

xamSchedule Washing2.png

手順

以下の手順は、 xamSchedule の 配色をウォッシュするための基本的な手順です。詳細については、以下のコード例を参照してください。

  1. ResourceWasher を作成します。

XAML かコードで ResourceWasher のインスタンスを作成します。

  1. ResourceWasher を構成します。

個々のニーズに応じて ResourceWasher を構成します ( WashColor プロパティと SourceDictionary プロパティの設定など)。ResourceWasher の使用方法については、 ResourceWasher のトピックも参照してください。

  1. Resources に ResourceWasher を追加します。

アプリケーションまたはページのリソースに ResourceWasher を追加します。

コード例

コード例の概要

以下の表は、このトピックで使用したコード例をまとめたものです。

例 解説

このコード例では、XAML による配色のウォッシュ方法を紹介します。

このコード例では、C# による配色のウォッシュ方法を紹介します。

このコード例では、VB による配色のウォッシュ方法を紹介します。

XAML による配色のウォッシュ – コード例

解説

このコード例では、XAML による配色のウォッシュ方法を紹介します。

コード

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>

C# による配色のウォッシュ – コード例

解説

このコード例では、C# による配色のウォッシュ方法を紹介します。

コード

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;

Visual Basic による配色のウォッシュ – コード例

解説

このコード例では、VB による配色のウォッシュ方法を紹介します。

コード

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

関連コンテンツ

トピック

このトピックについては、以下のトピックも参照してください。

トピック 目的

このトピックでは、Resource Washer コントロールを紹介します。

このトピックでは、Resource Washer コンポーネントを紹介し、アプリケーションの全体的な配色の変更方法を解説します。

xamSchedule のカスタム カラー スキームの作成を説明します。