123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- <UserControl
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:PRSDesktop"
- xmlns:Kanban="clr-namespace:Syncfusion.UI.Xaml.Kanban;assembly=Syncfusion.SfKanban.WPF"
- x:Class="PRSDesktop.TasksByStatusControl"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="400">
- <UserControl.Resources>
- <local:StatusTasksHeaderTimeConverter x:Key="StatusTasksHeaderTimeConverter" />
- <local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
-
- <Style x:Key="employeeStyle" TargetType="{x:Type TextBlock}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding AssignedTo}" Value="">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
-
- <Style x:Key="managerStyle" TargetType="{x:Type TextBlock}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Manager}" Value="">
- <Setter Property="Visibility" Value="Collapsed"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
-
- <Style x:Key="jobStyle" TargetType="{x:Type TextBlock}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding JobNumber}" Value="">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- <Style x:Key="descriptionStyle" TargetType="{x:Type TextBlock}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Path=Description}" Value="">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- <Style x:Key="notesStyle" TargetType="{x:Type TextBlock}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Path=Notes}" Value="">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- <DataTemplate x:Key="KanbanHeader">
- <!--<Border BorderThickness="0.75" BorderBrush="Gray" CornerRadius="5,5,0,0" Margin="0,10,0,0" Padding="5" Width="{Binding Converter={StaticResource TaskHeaderWidthConverter}}" Background="WhiteSmoke">-->
- <StackPanel Orientation="Vertical">
- <TextBlock Text="{Binding Header}" FontSize="16" FontWeight="DemiBold" HorizontalAlignment="Left"
- Margin="10,0,10,0" />
- <TextBlock FontSize="12" HorizontalAlignment="Left" Margin="10,0,5,0">
- <Run Text="{Binding CardCount}" />
- <Run Text="Tasks /" />
- <Run Text="{Binding Converter={StaticResource StatusTasksHeaderTimeConverter}, Mode=OneWay}" />
- <Run Text="Hours" />
- </TextBlock>
- </StackPanel>
- <!--</Border>-->
- </DataTemplate>
- <DataTemplate x:Key="FullKanban">
- <Border BorderBrush="Gray" BorderThickness="0.75" CornerRadius="5" Background="{Binding ColorKey}"
- Margin="0,2,0,2" MouseLeftButtonDown="Border_MouseLeftButtonDown" Tag="{Binding}">
- <Grid Margin="4">
- <Grid.ColumnDefinitions>
- <ColumnDefinition x:Name="colImage" Width="Auto" />
- <ColumnDefinition x:Name="colCheckbox" Width="Auto" />
- <ColumnDefinition x:Name="colDescription" Width="*" />
- <ColumnDefinition x:Name="colType" Width="Auto" />
- <ColumnDefinition x:Name="colAttach" Width="Auto" />
- <ColumnDefinition x:Name="colDueDate" Width="Auto" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Border Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Width="40" Height="40" CornerRadius="20"
- Margin="0,0,4,0" BorderBrush="Black" BorderThickness="1" VerticalAlignment="Top">
- <Border.Background>
- <ImageBrush ImageSource="{Binding Path=Image}" Stretch="UniformToFill" />
- </Border.Background>
- </Border>
- <CheckBox Grid.Row="0" Grid.Column="1" Margin="0,0,4,0" VerticalAlignment="Center"
- IsChecked="{Binding Path=Checked}" Checked="CheckBox_Checked"
- Unchecked="CheckBox_Checked" Tag="{Binding}" />
- <TextBlock Grid.Row="0" Grid.Column="2" Margin="0,0,0,0" FontWeight="DemiBold" FontSize="12"
- VerticalAlignment="Center">
- <Run Text="{Binding Path=Number}" /><Run Text=": " /><Run Text="{Binding Path=Title}" />
- </TextBlock>
- <TextBlock Grid.Row="0" Grid.Column="3" FontSize="12" Margin="4,0,0,0" Text="{Binding Path=Type.Code}"
- FontWeight="DemiBold" VerticalAlignment="Center" HorizontalAlignment="Center" />
- <Image Grid.Row="0" Grid.Column="4" Margin="4,0,4,0"
- Source="pack://application:,,,Resources/attachment.png"
- Visibility="{Binding Path=Attachments, Converter={StaticResource BoolToVisibilityConverter}}"
- Width="16" Height="16" VerticalAlignment="Center" />
- <TextBlock Grid.Row="0" Grid.Column="5" Text="{Binding DueDate, StringFormat='{}{0:dd MMM yy}'}"
- FontWeight="Bold" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" />
- <TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="5" Margin="0,0,0,0" FontSize="12"
- HorizontalAlignment="Left" Text="{Binding Path=Description}" VerticalAlignment="Stretch"
- TextWrapping="Wrap" />
- <DockPanel Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="5">
- <TextBlock DockPanel.Dock="Right" x:Name="Job" Margin="0" FontWeight="DemiBold" FontSize="12"
- VerticalAlignment="Center" TextAlignment="Right" Style="{StaticResource jobStyle}">
- <Run Text="{Binding JobNumber}" /><Run Text=": " /><Run Text="{Binding JobName}" />
- </TextBlock>
- <TextBlock DockPanel.Dock="Left" x:Name="Staff" FontWeight="DemiBold" FontSize="12"
- VerticalAlignment="Center" Text="{Binding AssignedTo}"
- Style="{StaticResource employeeStyle}" />
- </DockPanel>
- <Image Grid.Row="2" Grid.Column="0" Margin="0,0,4,0"
- Source="pack://application:,,,Resources/lock.png"
- Visibility="{Binding Path=Locked, Converter={StaticResource BoolToVisibilityConverter}}"
- Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" />
- </Grid>
- <Border.ToolTip>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Row="0" Grid.Column="0">
- <Run FontWeight="DemiBold" Text="{Binding Path=Title}"/>
- </TextBlock>
- <TextBlock Grid.Row="1" Grid.Column="0" Style="{StaticResource descriptionStyle}">
- <Run Text="{Binding Path=Description}"/>
- </TextBlock>
- <TextBlock Grid.Row="2" Grid.Column="0" Style="{StaticResource notesStyle}">
- <LineBreak/>
- <Run Text="{Binding Path=Notes}"/>
- </TextBlock>
- </Grid>
- </Border.ToolTip>
-
- <Border.ContextMenu>
- <ContextMenu x:Name="TaskMenu" Tag="{Binding}" Opened="TaskMenu_Opened" />
- </Border.ContextMenu>
- </Border>
- </DataTemplate>
- <DataTemplate x:Key="CompactKanban">
- <Border BorderBrush="Gray" BorderThickness="0.75" CornerRadius="5" Background="{Binding ColorKey}" Margin="0,2,0,2" MouseLeftButtonDown="Border_MouseLeftButtonDown" Tag="{Binding}">
-
- <DockPanel Margin="4">
- <TextBlock DockPanel.Dock="Right" Text="{Binding DueDate, StringFormat='{}{0:dd MMM yy}'}" FontWeight="Bold" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" />
- <CheckBox DockPanel.Dock="Left" Margin="0,0,4,0" VerticalAlignment="Center" IsChecked="{Binding Path=Checked}" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked" Tag="{Binding}" />
- <TextBlock DockPanel.Dock="Left" x:Name="JobNumber" Margin="0" FontWeight="DemiBold" FontSize="12" VerticalAlignment="Center" Style="{StaticResource jobStyle}">
- <Run Text="{Binding JobNumber}"/><Run Text="/"/>
- </TextBlock>
- <TextBlock DockPanel.Dock="Left" Margin="0,0,0,0" FontWeight="DemiBold" FontSize="12" VerticalAlignment="Center">
- <Run Text="{Binding Path=Number}"/><Run Text=": "/>
- </TextBlock>
- <TextBlock DockPanel.Dock="Left" Margin="0,0,0,0" FontWeight="DemiBold" FontSize="12" VerticalAlignment="Center" Text="{Binding Path=Title}" />
- <TextBlock DockPanel.Dock="Left" x:Name="Manager" Margin="0" FontWeight="DemiBold" FontSize="12" VerticalAlignment="Center" Style="{StaticResource managerStyle}">
- <Run Text=" ("/><Run Text="{Binding Manager}"/><Run Text=")"/>
- </TextBlock>
- <TextBlock DockPanel.Dock="Left" x:Name="Employee" Margin="0" FontWeight="DemiBold" FontSize="12" VerticalAlignment="Center" Style="{StaticResource employeeStyle}">
- <Run Text=" ("/><Run Text="{Binding AssignedTo}"/><Run Text=")"/>
- </TextBlock>
- </DockPanel>
- <Border.ToolTip>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <TextBlock Grid.Row="0" Grid.Column="0">
- <Run FontWeight="DemiBold" Text="{Binding Path=Title}"/>
- </TextBlock>
- <TextBlock Grid.Row="1" Grid.Column="0" Style="{StaticResource descriptionStyle}">
- <Run Text="{Binding Path=Description}"/>
- </TextBlock>
- <TextBlock Grid.Row="2" Grid.Column="0" Style="{StaticResource notesStyle}">
- <LineBreak/>
- <Run Text="{Binding Path=Notes}"/>
- </TextBlock>
- </Grid>
- </Border.ToolTip>
- <Border.ContextMenu>
- <ContextMenu x:Name="TaskMenu" Tag="{Binding}" Opened="TaskMenu_Opened" />
- </Border.ContextMenu>
-
- </Border>
- </DataTemplate>
-
- </UserControl.Resources>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" x:Name="EmployeeListColumn" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border Grid.Row="0" Grid.Column="0" CornerRadius="5,5,0,0" BorderBrush="Gray" BorderThickness="0.75"
- Background="WhiteSmoke" Padding="5" Margin="0,0,4,2">
- <Label Content="Employee List" HorizontalContentAlignment="Center" />
- </Border>
- <ListView Grid.Column="0" Grid.Row="1" x:Name="Employees" HorizontalAlignment="Stretch"
- SelectionChanged="Employees_SelectionChanged" Margin="0,0,4,0" Background="White" BorderBrush="Gray"
- BorderThickness="0.75">
- <ListView.ItemTemplate>
- <DataTemplate>
- <Grid HorizontalAlignment="Stretch" Margin="4,2,4,2">
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
- <Border Width="40" Height="40" CornerRadius="20" BorderBrush="Black" BorderThickness="1"
- VerticalAlignment="Center" HorizontalAlignment="Center">
- <Border.Background>
- <ImageBrush ImageSource="{Binding Path=Image}" Stretch="UniformToFill" />
- </Border.Background>
- </Border>
- <TextBlock x:Name="PCName" Height="Auto" TextWrapping="Wrap" Width="80" Margin="4,0,0,0"
- TextAlignment="Left" Text="{Binding Name}" VerticalAlignment="Center" />
- </StackPanel>
- </Grid>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- <Border Grid.Row="0" Grid.Column="1" CornerRadius="5,5,0,0" BorderBrush="Gray" BorderThickness="0.75"
- Background="WhiteSmoke" Padding="5" Margin="0,0,0,2">
- <DockPanel>
- <Button DockPanel.Dock="Left" x:Name="TaskTypesLabel" Content="Filter" Padding="4,0" Click="TaskTypesLabel_OnClick" />
- <ComboBox DockPanel.Dock="Left" x:Name="TaskTypes" Margin="5,0,0,0" Width="150" SelectedIndex="0"
- SelectionChanged="TaskTypes_SelectionChanged" VerticalContentAlignment="Center"
- SelectedValuePath="Key" DisplayMemberPath="Value" />
- <Button DockPanel.Dock="Left" x:Name="JobFilterBtn" Content="Filter Job" Padding="4,0" Margin="5,0,0,0" Click="JobFilterBtn_OnClick" />
- <Label DockPanel.Dock="Left" Content="Search" Margin="5,0,0,0" />
- <Button DockPanel.Dock="Right" x:Name="Export" Padding="10,0" Margin="5,0,0,0" Content="Export"
- Click="Export_Click" />
- <CheckBox DockPanel.Dock="Right" x:Name="IncludeCompleted" Margin="10,0,5,0"
- Content="Include Completed" VerticalAlignment="Center" HorizontalAlignment="Right"
- Checked="IncludeCompleted_Checked" Unchecked="IncludeCompleted_Checked" />
- <CheckBox DockPanel.Dock="Right" x:Name="IncludeObserved" Margin="10,0,5,0" Content="Include Observing"
- VerticalAlignment="Center" HorizontalAlignment="Right" Checked="IncludeObserved_Checked"
- Unchecked="IncludeObserved_Checked" />
- <CheckBox DockPanel.Dock="Right" x:Name="IncludeLocked" Margin="10,0,5,0" Content="Include Locked"
- VerticalAlignment="Center" HorizontalAlignment="Right" Checked="IncludeLocked_Checked"
- Unchecked="IncludeLocked_Checked" />
- <ComboBox DockPanel.Dock="Right" x:Name="ViewType" Margin="5,0,0,0" Width="100" SelectedIndex="0"
- SelectionChanged="ViewType_SelectionChanged" VerticalContentAlignment="Center">
- <ComboBoxItem Content="Full" />
- <ComboBoxItem Content="Compact" />
- </ComboBox>
- <Label DockPanel.Dock="Right" x:Name="ViewTypeLabel" Content="View" Margin="5,0,0,0" />
- <TextBox DockPanel.Dock="Left" x:Name="Search" Margin="5,0,0,0" HorizontalAlignment="Stretch"
- VerticalContentAlignment="Center" KeyUp="Search_KeyUp" />
- </DockPanel>
- </Border>
- <Kanban:SfKanban
- x:Name="Kanban"
- Grid.Column="1"
- Grid.Row="1"
- Margin="0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- HorizontalContentAlignment="Stretch"
- VerticalContentAlignment="Stretch"
- AutoGenerateColumns="False"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Background="WhiteSmoke"
- CardTemplate="{StaticResource FullKanban}"
- ColumnHeaderTemplate="{StaticResource KanbanHeader}"
- SizeChanged="Kanban_SizeChanged"
- CardDragStart="Kanban_CardDragStart"
- CardDragEnd="Kanban_CardDragEnd" />
- </Grid>
- </UserControl>
|