152 lines
No EOL
11 KiB
XML
152 lines
No EOL
11 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:controls="clr-namespace:DjRedo.Controls"
|
|
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"
|
|
xmlns:converters="clr-namespace:DjRedo.Converters"
|
|
xmlns:converters1="clr-namespace:Plume.WPF.Converters;assembly=Plume.WPF"
|
|
mc:Ignorable="d">
|
|
<Style TargetType="controls:StepControl">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="controls:StepControl">
|
|
<StackPanel Orientation="Horizontal" ToolTip="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=StepData.StepName}">
|
|
<StackPanel.Resources>
|
|
<converters:PercentToDegree x:Key="PercentToDegree" />
|
|
<converters:TrueToVisibleConverter x:Key="TrueToVisibleConverter" />
|
|
<converters:DjRedoStartedStepToTrueConverter x:Key="DjRedoStartedStepToTrue" />
|
|
</StackPanel.Resources>
|
|
<ContentControl VerticalAlignment="Center" DataContext="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}">
|
|
<ContentControl.Style>
|
|
<Style TargetType="ContentControl">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<TextBlock>Nothing to show</TextBlock>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Path=StepData.InfiniteSpin}" Value="True">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<shared:RingSpinner Width="16" Height="16" IsSpinning="{Binding Path=StepData.State, Converter={StaticResource DjRedoStartedStepToTrue}}" />
|
|
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding Path=StepData.Description}" />
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Path=StepData.InfiniteSpin}" Value="False">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<shared:RingSlice Radius="8"
|
|
EndAngle="{Binding Path=StepData.Progress, Converter={StaticResource PercentToDegree}}"
|
|
StartAngle="0"
|
|
StrokeThickness="2"
|
|
StrokeStartLineCap="Round"
|
|
StrokeEndLineCap="Triangle"
|
|
Stroke="#77b4c3" />
|
|
|
|
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0">
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0}% - {1}">
|
|
<Binding Path="StepData.Progress"></Binding>
|
|
<Binding Path="StepData.Description"></Binding>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Path=StepData.State}" Value="Failed">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Foreground="Red" ToolTip="The task has failed">X</TextBlock>
|
|
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding Path=StepData.Description}" />
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Path=StepData.State}" Value="Successed">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Viewbox Width="16" ToolTip="The task is successful">
|
|
<Path Name="TickMark" Stroke="Green" Data="F1 M 0.468732,4.66838L 3.03345,7.95443L 7.28127,0.420569" />
|
|
</Viewbox>
|
|
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding Path=StepData.Description}" />
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Path=StepData.State}" Value="Stopped">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Foreground="DarkBlue" ToolTip="The task has been stopped">?</TextBlock>
|
|
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding Path=StepData.Description}" />
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Path=StepData.State}" Value="NotStarted">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock ToolTip="The task is not started yet" Text="{Binding Path=StepData.Order, StringFormat='{}{0} - '}"></TextBlock>
|
|
<TextBlock VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding Path=StepData.Description}" />
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ContentControl.Style>
|
|
</ContentControl>
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<converters:DebugConverter x:Key="Debugconverter" />
|
|
<Style TargetType="controls:DjredoStarterControl">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="controls:DjredoStarterControl">
|
|
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Steps}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel></StackPanel>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<controls:StepControl StepData="{Binding}" Margin="4,4,0,0"></controls:StepControl>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ResourceDictionary> |