123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- <UserControl x:Class="PRSDesktop.TasksByUserControl"
- 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:dynamicgrid="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
- xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
- xmlns:kanban="clr-namespace:Syncfusion.UI.Xaml.Kanban;assembly=Syncfusion.SfKanban.WPF"
- xmlns:local="clr-namespace:PRSDesktop"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <local:UserTasksHeaderImageConverter x:Key="UserTasksHeaderImageConverter" />
- <local:UserTasksHeaderTimeConverter x:Key="UserTasksHeaderTimeConverter" />
- <local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
- <!--<local:TaskHeaderWidthConverter x:Key="TaskHeaderWidthConverter"/>-->
- <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">-->
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Width="40" Height="40" CornerRadius="20"
- Margin="5" BorderBrush="Gray" BorderThickness="0.75" VerticalAlignment="Center"
- HorizontalAlignment="Center">
- <Border.Background>
- <ImageBrush ImageSource="{Binding Converter={StaticResource UserTasksHeaderImageConverter}}"
- Stretch="UniformToFill" />
- </Border.Background>
- </Border>
- <TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Header}" FontSize="16" FontWeight="DemiBold"
- HorizontalAlignment="Left" Margin="10,0,10,0" />
- <TextBlock Grid.Column="1" Grid.Row="1" FontSize="12" HorizontalAlignment="Left" Margin="10,0,5,0">
- <Run Text="{Binding CardCount}" />
- <Run Text="Tasks /" />
- <Run Text="{Binding Converter={StaticResource UserTasksHeaderTimeConverter}, Mode=OneWay}" />
- <Run Text="Hours" />
- </TextBlock>
- </Grid>
- <!--</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="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>
- <CheckBox Grid.Row="0" Grid.Column="0" 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="1" Margin="0,0,0,0" FontWeight="DemiBold" FontSize="12"
- VerticalAlignment="Center" TextTrimming="CharacterEllipsis">
- <Run Text="{Binding Path=Number}" /><Run Text=": " /><Run Text="{Binding Path=Title}" />
- </TextBlock>
- <TextBlock Grid.Row="1" Grid.Column="4" FontSize="12" Margin="4,0,0,0" Text="{Binding Path=Type.Code}"
- FontWeight="DemiBold" VerticalAlignment="Center" HorizontalAlignment="Right" />
- <Image Grid.Row="0" Grid.Column="3" 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="4" Text="{Binding DueDate, StringFormat='{}{0:dd MMM yy}'}" Margin="5,0,0,0"
- FontWeight="Bold" FontSize="12" VerticalAlignment="Center" HorizontalAlignment="Center" />
- <TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="0,0,0,0" FontSize="12"
- HorizontalAlignment="Left" Text="{Binding Path=Description}" VerticalAlignment="Stretch"
- TextWrapping="Wrap" />
- <DockPanel Grid.Row="2" Grid.Column="0" 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>
- </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>
-
- <DataTemplate x:Key="SwimLaneHeaderTemplate">
- <Grid>
- <Border BorderBrush="Gray" BorderThickness="0.75" Height="0.75" Margin="10,0,15,0"
- HorizontalAlignment="Stretch" />
- <Border BorderBrush="Gray" BorderThickness="0.75" Margin="0,5,0,0" HorizontalAlignment="Center"
- Width="300" Background="WhiteSmoke">
- <StackPanel Background="Transparent" x:Name="SwimlaneHeaderPanel" Orientation="Horizontal">
- <Grid x:Name="CollapsedIcon" Background="Transparent" Height="30" Width="30">
- <Path x:Name="ExpandedPath" IsHitTestVisible="False"
- Data="M30.587915,0L31.995998,1.4199842 15.949964,17.351 0,1.4979873 1.4099131,0.078979151 15.949964,14.53102z"
- Stretch="Uniform" Fill="#FF000000" Width="14" Height="14" Margin="0,0,0,0"
- RenderTransformOrigin="0.5,0.5">
- <Path.RenderTransform>
- <TransformGroup>
- <TransformGroup.Children>
- <RotateTransform Angle="0" />
- <ScaleTransform ScaleX="1" ScaleY="1" />
- </TransformGroup.Children>
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- <Path x:Name="CollapsedPath" Visibility="Collapsed" IsHitTestVisible="False"
- Data="M1.4200482,0L17.351001,16.046996 1.4980513,31.996001 0.078979631,30.585997 14.531046,16.046019 0,1.4089964z"
- Stretch="Uniform" Fill="#FF000000" Width="14" Height="14" Margin="0,0,0,0"
- RenderTransformOrigin="0.5,0.5">
- <Path.RenderTransform>
- <TransformGroup>
- <TransformGroup.Children>
- <RotateTransform Angle="0" />
- <ScaleTransform ScaleX="1" ScaleY="1" />
- </TransformGroup.Children>
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </Grid>
- <TextBlock FontWeight="Medium" IsHitTestVisible="False" FontSize="15" FontStretch="Expanded"
- TextWrapping="NoWrap" VerticalAlignment="Center" Text="{Binding Title}"
- HorizontalAlignment="Center" TextAlignment="Center" />
- </StackPanel>
- </Border>
- </Grid>
- </DataTemplate>
- </UserControl.Resources>
- <dynamicgrid:DynamicSplitPanel x:Name="SplitPanel" View="Combined" AnchorWidth="100" AllowableViews="Combined"
- OnChanged="SplitPanel_OnChanged">
- <dynamicgrid:DynamicSplitPanel.Master>
- <Grid x:Name="EmployeeGrid" Margin="0" Grid.Column="1" Grid.Row="0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition x:Name="TeamsRow" Height="200" />
- <RowDefinition x:Name="SplitterRow" Height="4" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Border
- Grid.Row="0"
- BorderBrush="Gray"
- BorderThickness="0.75,0.75,0.75,0"
- CornerRadius="5,5,0,0"
- Background="WhiteSmoke"
- Height="30">
- <Label Content="Teams" HorizontalContentAlignment="Center" FontWeight="Bold"
- VerticalContentAlignment="Center" />
- </Border>
- <syncfusion:CheckListBox
- Grid.Row="1"
- x:Name="SelectedTeams"
- DisplayMemberPath="Value"
- SelectedValuePath="Key"
- IsSelectAllEnabled="False"
- IsCheckOnFirstClick="True"
- Margin="0"
- ItemChecked="SelectedTeams_ItemChecked"
- SizeChanged="SelectedTeams_SizeChanged"
- VerticalAlignment="Stretch"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Background="White" />
- <syncfusion:SfGridSplitter
- Grid.Row="2"
- x:Name="TeamSplitter"
- ResizeBehavior="PreviousAndNext"
- Height="4"
- HorizontalAlignment="Stretch"
- Background="Transparent"
- Template="{StaticResource HorizontalSplitter}"
- PreviewStyle="{StaticResource HorizontalSplitterPreview}" />
- <Border
- Grid.Row="3"
- BorderBrush="Gray"
- BorderThickness="0.75,0.75,0.75,0"
- CornerRadius="5,5,0,0"
- Background="WhiteSmoke"
- Height="30">
- <Label Content="Employees" HorizontalContentAlignment="Center" FontWeight="Bold"
- VerticalContentAlignment="Center" />
- </Border>
- <syncfusion:CheckListBox
- Grid.Row="4"
- x:Name="SelectedEmployees"
- DisplayMemberPath="Value"
- SelectedValuePath="Key"
- IsCheckOnFirstClick="True"
- SelectionChanged="EmployeesSelectionChanged"
- IsSelectAllEnabled="False"
- Background="White"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Margin="0" />
- </Grid>
- </dynamicgrid:DynamicSplitPanel.Master>
- <dynamicgrid:DynamicSplitPanel.Detail>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border
- Background="WhiteSmoke"
- BorderThickness="0.75,0.75,0.75,0"
- BorderBrush="Gray"
- CornerRadius="5,5,0,0"
- Grid.Row="0"
- Height="30"
- Padding="2">
- <DockPanel>
- <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="IncludeManaged" Margin="10,0,5,0"
- Content="Include Managed" VerticalAlignment="Center" HorizontalAlignment="Right"
- Checked="IncludeManaged_Checked" Unchecked="IncludeManaged_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" />
- <ComboBox DockPanel.Dock="Right" x:Name="TaskType" Margin="5,0,0,0" Width="150"
- SelectedIndex="0" SelectionChanged="TaskType_SelectionChanged"
- VerticalContentAlignment="Center">
- </ComboBox>
- <Label DockPanel.Dock="Right" x:Name="TaskTypeLabel" Content="Type" 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
- SizeChanged="Kanban_SizeChanged"
- Grid.Row="1"
- Margin="0"
- x:Name="Kanban"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- HorizontalContentAlignment="Stretch"
- VerticalContentAlignment="Stretch"
- AutoGenerateColumns="False"
- BorderThickness="0.75"
- BorderBrush="Gray"
- Background="White"
- CardTemplate="{StaticResource FullKanban}"
- ColumnHeaderTemplate="{StaticResource KanbanHeader}"
- SwimlaneKey="Assignee"
- SwimlaneHeaderTemplate="{StaticResource SwimLaneHeaderTemplate}"
- CardDragStart="Kanban_CardDragStart"
- CardDragEnd="Kanban_CardDragEnd"/>
- </Grid>
- </dynamicgrid:DynamicSplitPanel.Detail>
- </dynamicgrid:DynamicSplitPanel>
- </UserControl>
|