In App.xaml.cs
<Style x:Key="ScheduleCellStyle"
TargetType="ContentControl">
<Setter Property="FontWeight"
Value="Bold" />
<Setter Property="Foreground"
Value="Black" />
</Style>
In MainWindow.cs
private void Gantt_ScheduleCellCreated(object sender, ScheduleCellCreatedEventArgs args)
{
if (args.CurrentCell.CellTimeUnit == TimeUnit.Days && args.CurrentCell.CellDate.DayOfWeek == DayOfWeek.Sunday)
{
args.CurrentCell.Style = Application.Current.Resources["ScheduleCellStyle"] as Style;
}
else
{
args.CurrentCell.Style = null;
}
} |
Hi,
i have looked also for Text decoration porperty in order to set Undeline but i don not find it.
Is it possible to set?
Best regards
Gian Piero Truccolo
<Application.Resources>
<Style x:Key="scheduleStyle" TargetType="{x:Type schedule:GanttScheduleCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type schedule:GanttScheduleCell}">
<Border BorderThickness="0,0,1,1"
BorderBrush="Black" >
<TextBlock Name="TextBlock1" Margin="10,10,0,0" VerticalAlignment="Center"
HorizontalAlignment="Center" Text="{TemplateBinding Content}"
FontSize="8" FontFamily="Verdana" Padding="0,0,0,3" TextDecorations="Underline">
<ToolTipService.ToolTip>
<ToolTip Content="{TemplateBinding CellToolTip}"/>
</ToolTipService.ToolTip>
</TextBlock>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Application.Resources> |
private void Gantt_ScheduleCellCreated(object sender, ScheduleCellCreatedEventArgs args)
{
if (args.CurrentCell.CellTimeUnit == TimeUnit.Days && args.CurrentCell.CellDate.DayOfWeek == DayOfWeek.Monday)
{
args.CurrentCell.Style = Application.Current.Resources["scheduleStyle"] as Style;
}
} |