123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:converter="clr-namespace:PDF_Master.DataConvert"
- xmlns:local="clr-namespace:PDF_Master.CustomControl">
- <converter:IsLastItemConverter x:Key="IsLastItemConverter" />
- <converter:IsProgressedConverter x:Key="IsProgressedConverter" />
- <Style TargetType="{x:Type local:StepBarItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:StepBarItem}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <StackPanel Orientation="Horizontal">
- <ContentPresenter VerticalAlignment="Center" Visibility="Collapsed" />
- <Grid>
- <!--<TextBlock
- x:Name="path"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="{StaticResource FontAwesome}"
- FontSize="20"
- FontWeight="Light"
- Foreground="{TemplateBinding Foreground}"
- Text=""
- Visibility="Collapsed" />-->
- <!--<Button
- Name="BtnIcon"
- Width="30"
- Height="30"
- Background="LightBlue"
- BorderBrush="Black"
- BorderThickness="1"
- Content="{Binding Path=Number, RelativeSource={RelativeSource TemplatedParent}}">
- <Button.Template>
- <ControlTemplate TargetType="Button">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="15">
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
- </Border>
- </ControlTemplate>
- </Button.Template>
- </Button>-->
- <Ellipse
- Name="BtnIcon"
- Width="24"
- Height="23"
- Fill="LightBlue"
- Stroke="Black"
- StrokeThickness="0" />
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="White"
- Text="{Binding Path=Number, RelativeSource={RelativeSource TemplatedParent}}" />
- </Grid>
- </StackPanel>
- <Border
- x:Name="Line"
- Grid.Column="1"
- MinWidth="{Binding LineMinLength, RelativeSource={RelativeSource AncestorType=local:StepBar}}"
- Margin="0"
- VerticalAlignment="Center"
- BorderBrush="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}"
- BorderThickness="0,2,0,0"
- SnapsToDevicePixels="True"
- UseLayoutRounding="True"
- Visibility="Collapsed" />
- </Grid>
- <ControlTemplate.Triggers>
- <DataTrigger Value="True">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsLastItemConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="Items.Count" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="Visibility" Value="Collapsed" />
- <Setter Property="HorizontalAlignment" Value="Left" />
- </DataTrigger>
- <DataTrigger Value="False">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsLastItemConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="Items.Count" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="Visibility" Value="Visible" />
- </DataTrigger>
- <DataTrigger Value="Less">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsProgressedConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="CurrentIndex" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="BorderBrush" Value="{Binding ActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter TargetName="BtnIcon" Property="Fill" Value="{Binding ActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter Property="Foreground" Value="{Binding ActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- </DataTrigger>
- <DataTrigger Value="Equal">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsProgressedConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="CurrentIndex" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="BorderBrush" Value="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter TargetName="BtnIcon" Property="Fill" Value="{Binding ActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter Property="Foreground" Value="{Binding ActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- </DataTrigger>
- <DataTrigger Value="Large">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsProgressedConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="CurrentIndex" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="BorderBrush" Value="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter TargetName="BtnIcon" Property="Fill" Value="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter Property="Foreground" Value="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Orientation, RelativeSource={RelativeSource AncestorType=local:StepBar}}" Value="Vertical">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:StepBarItem}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <StackPanel Orientation="Vertical">
- <Grid Margin="0,0,0,0">
- <TextBlock
- x:Name="path"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="{StaticResource FontAwesome}"
- FontSize="20"
- FontWeight="Thin"
- Foreground="{TemplateBinding Foreground}"
- Text=""
- Visibility="Collapsed" />
- </Grid>
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
- </StackPanel>
- <Border
- x:Name="Line"
- Grid.Row="1"
- MinHeight="{Binding LineMinLength, RelativeSource={RelativeSource AncestorType=local:StepBar}}"
- Margin="13,0,0,0"
- VerticalAlignment="Center"
- BorderBrush="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}"
- BorderThickness="1,0,0,0"
- SnapsToDevicePixels="True"
- UseLayoutRounding="True"
- Visibility="Collapsed" />
- </Grid>
- <ControlTemplate.Triggers>
- <DataTrigger Value="True">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsLastItemConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="Items.Count" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="Visibility" Value="Collapsed" />
- <Setter Property="HorizontalAlignment" Value="Left" />
- </DataTrigger>
- <DataTrigger Value="False">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsLastItemConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="Items.Count" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="Visibility" Value="Visible" />
- </DataTrigger>
- <DataTrigger Value="Less">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsProgressedConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="CurrentIndex" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="BorderBrush" Value="{Binding ActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter TargetName="path" Property="Visibility" Value="Visible" />
- <Setter Property="Foreground" Value="{Binding ActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- </DataTrigger>
- <DataTrigger Value="Equal">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsProgressedConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="CurrentIndex" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="BorderBrush" Value="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter TargetName="path" Property="Visibility" Value="Visible" />
- <Setter Property="Foreground" Value="{Binding ActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- </DataTrigger>
- <DataTrigger Value="Large">
- <DataTrigger.Binding>
- <MultiBinding Converter="{StaticResource IsProgressedConverter}">
- <Binding RelativeSource="{RelativeSource Self}" />
- <Binding Path="CurrentIndex" RelativeSource="{RelativeSource AncestorType={x:Type local:StepBar}}" />
- </MultiBinding>
- </DataTrigger.Binding>
- <Setter TargetName="Line" Property="BorderBrush" Value="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- <Setter TargetName="path" Property="Visibility" Value="Collapsed" />
- <Setter Property="Foreground" Value="{Binding UnActivateColor, RelativeSource={RelativeSource AncestorType=local:StepBar}}" />
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- <Style TargetType="{x:Type local:StepBar}">
- <Setter Property="HorizontalAlignment" Value="Left" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:StepBar}">
- <Border Background="{TemplateBinding Background}">
- <ScrollViewer PanningMode="HorizontalOnly" VerticalScrollBarVisibility="Disabled">
- <ItemsPresenter />
- </ScrollViewer>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <StackPanel IsItemsHost="True" Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Orientation}" Value="Vertical">
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <StackPanel IsItemsHost="True" Orientation="Vertical" />
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </ResourceDictionary>
|