Back to Devexpress

GanttView.ResourceStyle Property

wpf-devexpress-dot-xpf-dot-gantt-dot-ganttview-169d56bb.md

latest2.9 KB
Original Source

GanttView.ResourceStyle Property

Gets or sets a style applied to resources. This is a dependency property.

Namespace : DevExpress.Xpf.Gantt

Assembly : DevExpress.Xpf.Gantt.v25.2.dll

NuGet Package : DevExpress.Wpf.Gantt

Declaration

csharp
public Style ResourceStyle { get; set; }
vb
Public Property ResourceStyle As Style

Property Value

TypeDescription
Style

A style applied to resources.

|

Remarks

xaml
<dxgn:GanttControl ItemsSource="{Binding Tasks}">
    <dxgn:GanttControl.View>
        <dxgn:GanttView ResourcesSource="{Binding Resources}">
            <dxgn:GanttView.ResourceStyle>
                <Style TargetType="{x:Type dxgn:GanttResourceControl}">
                    <Setter Property="Background" Value="{Binding ResourceData.Color, 
                                                  Converter={dxmvvm:ColorToBrushConverter}}"/>
                    <Setter Property="CornerRadius" Value="0"/>
                    <Setter Property="Foreground" Value="White"/>
                    <Setter Property="BorderThickness" Value="0"/>
                    <Style.Triggers>
                        <EventTrigger RoutedEvent="MouseEnter">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Duration="0:0:0.2" From="1" To="0.35" 
                                                     Storyboard.TargetProperty="Opacity"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="MouseLeave">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Duration="0:0:0.2" From="0.35" To="1" 
                                                     Storyboard.TargetProperty="Opacity"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </Style.Triggers>
                </Style>
            </dxgn:GanttView.ResourceStyle>
        </dxgn:GanttView>
    </dxgn:GanttControl.View>
</dxgn:GanttControl>

See Also

GanttView Class

GanttView Members

DevExpress.Xpf.Gantt Namespace