Specify Colors, Styles?

Mar 11, 2010 at 8:28 PM

How does one specify a new background color, link color, etc.?

I can not find documentation on how to do this, but see samples with different color themes.

Mar 16, 2010 at 4:49 PM

Seriously?  Everyone is using the control exactly as it looks and aren't adjusting the colors, etc. at all???

Coordinator
Mar 18, 2010 at 2:22 AM

Please take a look at this example. It uses different templates and located in source tree.

http://asyrovprog.host22.com/news.php

Mar 18, 2010 at 7:28 PM

I saw that example, but have no idea how to change the colors and styles?   Do I have to manually open up the source and mess with it in MS Expression?  

Coordinator
Mar 20, 2010 at 5:39 PM

Yes, you have to change them manually or/and with help of Expression Blend.

 

Mar 22, 2010 at 10:03 PM

I have tried modifying them with Expression Blend, but the changes are ignored.   The links still appear light blue, not the light gray color I have set them to?

The following is the TimelinePage.xaml from inside the \Timeline folder.

<!--
 *   Copyright 2009 Andrew Syrov<asyrovprog@live.com>
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Library General Public License as
 *   published by the Free Software Foundation; either version 2 or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details
 *
 *   You should have received a copy of the GNU Library General Public
 *   License along with this program; if not, write to the
 *   Free Software Foundation, Inc.,
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *   
 -->

    <UserControl
    x:Class="Timeline.TimelinePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:timeline="clr-namespace:TimelineLibrary;assembly=TimelineLibrary"
    mc:Ignorable="d"
    d:DesignWidth="640"
    d:DesignHeight="560">
    
    <timeline:TimelineTray
        x:Name="Timeline"
        HorizontalAlignment="Stretch"
        VerticalAlignment="Stretch">
    	<timeline:TimelineBand HorizontalAlignment="Left" VerticalAlignment="Top"/>
    	<timeline:Hyperlink HorizontalAlignment="Left" VerticalAlignment="Top" Content="Hyperlink" Foreground="#FFE6E0D6"/>
    </timeline:TimelineTray>
    
</UserControl>

 

Coordinator
Mar 23, 2010 at 12:11 AM

This will not work like this. You need to provide your own style for TimelineBand and DefaultEventTemplate/DefaultItemTemplate as below. Please refer to SilverlightNews solution for example.

 <timeline:TimelineBand
                Grid.Row="1"
                IsMainBand="True"
                ItemSourceType="hours"
                HorizontalAlignment="Stretch"
                TimelineWindowSize="10"
                MaxEventHeight="210"
                Style="{StaticResource TimelineTemplateMainBand}"
                DefaultEventTemplate="{StaticResource TimelineEventStyle}"
                DefaultItemTemplate="{StaticResource ColumnTemplateStyle}" />

 

Mar 23, 2010 at 4:58 PM

Where are the SilverlightNews solution files located.  

The Sources download only contains these folders:

  • Timeline
  • Timeline.Web
  • TimelineLibrary
  • TimelineSL
  • TimelineSL.Web
  • WpfCustomControlLibrary1
  • WpfTimelineExample
  • WpfTimelineLibrary
Coordinator
Mar 24, 2010 at 12:33 AM

It is in the source code tree (not yet in downloads).

Mar 25, 2010 at 8:53 PM

Okay, so I downloaded this from the Source Tree.

I get this error when trying to build:  Could not find file 'C:\Temp\Timeline2\SilverlightNews\ColumnTemplateStyle.xaml'

I guess I just need a step-by-step of how to change a hyperlink color or background color or font color in this.

Coordinator
Mar 25, 2010 at 9:11 PM

This file is in source tree and I do not know why it cannot find it in your solution.

Mar 25, 2010 at 11:05 PM

App.xaml now looks like:

<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Timeline.App">
  <Application.Resources>
   <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
     <ResourceDictionary Source="ColumnTemplateStyle.xaml"/>
     <ResourceDictionary Source="SecondaryColumnStyle.xaml"/>
     <ResourceDictionary Source="ShortEventTemplate.xaml"/>
     <ResourceDictionary Source="TimelineEventTemplateStyle.xaml"/>
     <ResourceDictionary Source="TimelineTemplateMainBand.xaml"/>
     <ResourceDictionary Source="TimelineToolbarStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>
   </ResourceDictionary>
  </Application.Resources>
</Application>

Build, build succeeds, page looks the same?

 

 

Apr 15, 2010 at 5:44 PM

I am really having no luck with this... I tried duplicating what was done in the News example but it still appears like the default.   

I am new to the world of Silverlight templating and Expression Blend which may be a big part of the problem.

Could someone provide me a detailed step-by-step of how to change things like the background colors, the text colors, and the link colors?