Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Resource View (Read 6732 times)
kamesh
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 6th, 2011
Resource View
Oct 13th, 2011 at 2:17pm
Print Post  
Hi,

1.) I need to change the colour of weekend and
non working hours cells in the resource view.

2.) how to create custom theme or modify the existing theme like vista for the resource view.

Can you please help me on this issue...

many thanks
Kamesh
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Resource View
Reply #1 - Oct 13th, 2011 at 2:48pm
Print Post  
Hi,

1) The CustomResourceCells sample illustrates how to customize the appearance of individual cells in the Resource view by providing custom templates. You need to add a condition that checks if the cell represents a weekend or non-working hour. The time of the cell can be obtained from the CellPresenter object provided to the CellPresenterCreated event handler.

2) You cannot create custom themes but you can customize various aspects of the view appearance through the view settings. The settings of the Resource view can be obtained through the Calendar.ResourceViewSettings property. If you provide me with more details about what you would like to customize, I may be able to prepare a sample application to illustrate how to do it.

Regards,
Meppy
  
Back to top
 
IP Logged
 
kamesh
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 6th, 2011
Re: Resource View
Reply #2 - Oct 14th, 2011 at 9:08am
Print Post  
Thanks for your response meppy.

1.) I want to let you know that I have bought the full version of WPF Scheduling with the source code, Is it possible to create my own theme for the resource view.

2.) Customization details - I like to change the color, style etc of the appointment, calendar header, resource header of the resource view.

Can you please clear my doubts.

Regards,
Kamesh
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Resource View
Reply #3 - Oct 14th, 2011 at 11:10am
Print Post  
Hi,

1) Defining a custom theme will be a tedious task as it requires that all settings for all views are specified. If you are interested only in the the Resource view, you can probably reuse the settings of one of the other themes for the rest of the views, but the Resource view alone has a fair amount of properties.

Anyway, if you want to create a custom theme, have a look in the Theme.cs file. All of the standard themes are defined there. You need to add similar entries for your own theme as well as a new constant in the ThemeType enumeration.

2) A sample application, which demonstrates some of these customizations, can be downloaded from here. The sample also demonstrates how to custom-paint the weekend cells.

Regards,
Meppy
  
Back to top
 
IP Logged
 
kamesh
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 6th, 2011
Re: Resource View
Reply #4 - Oct 20th, 2011 at 2:42pm
Print Post  
Hi again, The other thing I am trying to do at the moment is mark certain times  (days, or hours) as a different shade.

Almost like marking times as "In a Meeting" or "Busy".

How can I (as I generate the data) mark these times on different resources and dates?

I hope I make sense with my question!

My problem is that I have a Generic List of Resources, and the "BREAKTIMES" and I need to shade (or style) these differently. Where should I begin?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Resource View
Reply #5 - Oct 21st, 2011 at 6:28am
Print Post  
You can use the same technique from the sample in my previous post. First you need to define a custom CellPresenter style. For example, the following style is a copy of the default cell style with its background set to PaleGoldenrod:

Code
Select All
<Style x:Key="CustomCellStyle" TargetType="{x:Type planner:CellPresenter}">
	<Style.Triggers>

		<DataTrigger Binding="{Binding StyleKey, RelativeSource={RelativeSource Self}}" Value="Simple">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type planner:CellPresenter}">

						<Border
							DataContext="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}"
							BorderBrush="{Binding CellStyle.BorderBrush}"
							BorderThickness="{Binding CellStyle.BorderThickness}"
							Background="PaleGoldenrod"
							Margin="{Binding CellStyle.Margin}" />

					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</DataTrigger>

	</Style.Triggers>

</Style> 


Then, you need to handle the Calendar.CellPresenterCreated event and conditionally apply the custom style to cells matching specific criteria:

Code
Select All
private void Calendar_CellPresenterCreated(object sender, CellPresenterEventArgs e)
{
	if (IsMeetingOrBusy(e.Presenter))
	{
		Style customStyle = FindResource("CustomCellStyle") as Style;
		if (customStyle != null)
			e.CellPresenter.Style = customStyle;
	}
} 


I hope this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint