ComponentOne Scheduler for WPF and Silverlight
Scheduler for Silverlight Tutorials / Creating a Custom View / Step 1 of 4: Creating the Application
In This Topic
    Step 1 of 4: Creating the Application
    In This Topic

    In this step you will create the Silverlight application and add the appropriate references and namespaces. You will also set the Brush Styles in your MainPage.xaml file.

    Follow these steps:

    1. Create a new Silverlight application in Visual Studio and name it CustomView.
    2. Add the following references to your application by right-clicking the References folder in the Solution Explorer and selecting Add Reference from the list. Browse to the folder where your references are located and select the following:
      • C1.Silverlight
      • C1.Silverlight.Data
      • C1.Silverlight.DateTimeEditors
      • C1.Silverlight.Schedule
    3. In your MainPage.xaml file, add the following to the namespace declarations:

      xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"

    4. Add the <UserControl.Resources> <UserControl.Resources/> tags below the namespace declarations.
    5. Click between the <UserControl.Resources> tags and insert the following XAML to provide the style and brush resources for the page:
      XMAL
      Copy Code
      <!-- Border Brush -->
          <LinearGradientBrush x:Key="BorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#FFA3AEB9" Offset="0"/>
              <GradientStop Color="#FF8399A9" Offset="0.375"/>
              <GradientStop Color="#FF718597" Offset="0.375"/>
              <GradientStop Color="#FF617584" Offset="1"/>
          </LinearGradientBrush>
      
          <!-- C1Menu styles-->
          <ControlTemplate TargetType="c1:C1Separator" x:Key="FirstLevelSeparatorTemplate">
              <Grid x:Name="Root" Background="#FF3C688D" Opacity="0.2" Margin="2,5,5,8" Width="0.5"/>
          </ControlTemplate>
              <Style TargetType="c1:C1Separator" x:Key="Separator">
              <Setter Property="FirstLevelTemplate" Value="{StaticResource FirstLevelSeparatorTemplate}"/>
              </Style>
      
          <!-- C1Scheduler brushes -->
          <!-- Current day header -->
          <LinearGradientBrush x:Key="C1Scheduler_TodayHeader_Brush" EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#FFF6CE71" Offset="0"/>
              <GradientStop Color="#FFF5C664" Offset="0.5"/>
              <GradientStop Color="#FFEF9F26" Offset="0.5"/>
              <GradientStop Color="#FFF4BE59" Offset="1"/>
          </LinearGradientBrush>
          <LinearGradientBrush x:Key="DayHeader_HoverBrush" EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#FFFFFCDE" Offset="0"/>
              <GradientStop Color="#FFFFEAAC" Offset="0.5"/>
              <GradientStop Color="#FFFFD767" Offset="0.5"/>
              <GradientStop Color="#FFFFE59B" Offset="1"/>
          </LinearGradientBrush>
          <LinearGradientBrush x:Key="TodayHeader_HoverBrush" EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#FFFFFCDE" Offset="0"/>
              <GradientStop Color="#FFFFEAAC" Offset="0.5"/>
              <GradientStop Color="#FFFFD767" Offset="0.5"/>
              <GradientStop Color="#FFFFE59B" Offset="1"/>
          </LinearGradientBrush>