123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- <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:wpf="clr-namespace:InABox.Wpf;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"
- d:DataContext="{d:DesignInstance Type=local:TasksByStatusControl}"
- mc:Ignorable="d"
- x:Name="Control"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="KanbanResources.xaml"/>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
- <UserControl.CommandBindings>
- <CommandBinding Command="{x:Static local:KanbanResources.EditTask}"
- Executed="EditTask_Executed"
- CanExecute="CommandBinding_CanExecute"/>
- <CommandBinding Command="{x:Static local:KanbanResources.OpenTaskMenu}"
- Executed="OpenTaskMenu_Executed"
- CanExecute="CommandBinding_CanExecute"/>
- <CommandBinding Command="{x:Static local:KanbanResources.SelectTask}"
- Executed="SelectTask_Executed"
- CanExecute="CommandBinding_CanExecute"/>
- </UserControl.CommandBindings>
- <dynamicgrid:DynamicSplitPanel x:Name="SplitPanel" View="Combined" AnchorWidth="100" AllowableViews="Combined"
- OnChanged="SplitPanel_OnChanged"
- DataContext="{Binding ElementName=Control}">
- <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.Name"
- SelectedValuePath="Key"
- IsCheckOnFirstClick="True"
- ItemChecked="SelectedEmployees_ItemChecked"
- 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="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border
- Background="WhiteSmoke"
- BorderThickness="0.75,0.75,0.75,0.75"
- BorderBrush="Gray"
- CornerRadius="5,5,0,0"
- Grid.Row="0"
- Padding="5">
- <DockPanel>
- <local:TaskPanelFilterButton DockPanel.Dock="Left"
- x:Name="FilterButton"
- OnFilterRefresh="TaskPanelFilterButton_OnFilterRefresh"
- OnFiltersSelected="FilterButton_OnFiltersSelected"/>
- <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>
- <ItemsControl Grid.Row="1" ItemsSource="{Binding Model.SectionHeaders}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Rows="1"/>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate DataType="local:TasksByUserEmployeeHeader">
- <Border BorderBrush="LightGray" BorderThickness="0,0,0,1">
- <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 Image}"
- Stretch="UniformToFill"/>
- </Border.Background>
- </Border>
- <TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Name}" 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 NumTasks,Mode=OneWay}" />
- <Run Text="Tasks /" />
- <Run Text="{Binding NumHours,Mode=OneWay, StringFormat={}{0:F2}}" />
- <Run Text="Hours" />
- </TextBlock>
- </Grid>
- </Border>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- <ScrollViewer Grid.Row="2">
- <ItemsControl ItemsSource="{Binding Path=Model.Categories}">
- <ItemsControl.ItemTemplate>
- <DataTemplate DataType="local:TasksByUserCategory">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition>
- <RowDefinition.Style>
- <Style TargetType="RowDefinition">
- <Setter Property="Height" Value="0"/>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Collapsed}" Value="False">
- <Setter Property="Height" Value="*"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </RowDefinition.Style>
- </RowDefinition>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="300"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Rectangle Grid.Row="0" Grid.Column="0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Center"
- Fill="LightGray"
- Height="1"/>
- <Rectangle Grid.Row="0" Grid.Column="2"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Center"
- Fill="LightGray"
- Height="1"/>
- <Button x:Name="FoldButton"
- Grid.Row="0"
- Grid.Column="1"
- Click="FoldButton_Click"
- Tag="{Binding}"
- Margin="5">
- <DockPanel>
- <Image Width="32" Height="32"
- RenderTransformOrigin="0.5,0.5" Source="pack://application:,,,/Resources/rightarrow.png"
- DockPanel.Dock="Left">
- <Image.Style>
- <Style TargetType="Image">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Collapsed}" Value="False">
- <Setter Property="RenderTransform">
- <Setter.Value>
- <RotateTransform Angle="90"/>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Image.Style>
- </Image>
- <Label Content="{Binding Status, Converter={StaticResource KanbanStatusToStringConverter}}"
- VerticalContentAlignment="Center"
- HorizontalContentAlignment="Left"
- DockPanel.Dock="Right"/>
- </DockPanel>
- </Button>
- <Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3">
- <ItemsControl Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3"
- ItemsSource="{Binding EmployeeCategories}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Rows="1"/>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate DataType="local:TasksByUserEmployeeCategory">
- <Border BorderBrush="LightGray"
- BorderThickness="0,0,1,0"
- Padding="5,0">
- <Grid Tag="{Binding}"
- Background="Transparent"
- AllowDrop="True"
- DragOver="ItemsControl_DragOver"
- Drop="ItemsControl_Drop">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- <RowDefinition>
- <RowDefinition.Style>
- <Style TargetType="{x:Type RowDefinition}">
- <Setter Property="Height" Value="75"/>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Mode,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:TasksByUserControl}}}"
- Value="{x:Static local:KanbanViewMode.Compact}">
- <Setter Property="Height" Value="30"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </RowDefinition.Style>
- </RowDefinition>
- </Grid.RowDefinitions>
- <ItemsControl Grid.Row="0"
- ItemsSource="{Binding Tasks,Mode=OneWay}">
- <ItemsControl.Style>
- <Style TargetType="{x:Type ItemsControl}">
- <Setter Property="ItemTemplate" Value="{StaticResource FullKanban}"/>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Mode,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:TasksByUserControl}}}"
- Value="{x:Static local:KanbanViewMode.Compact}">
- <Setter Property="ItemTemplate" Value="{StaticResource CompactKanban}"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </ItemsControl.Style>
- </ItemsControl>
- </Grid>
- </Border>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Border>
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </dynamicgrid:DynamicSplitPanel.Detail>
- </dynamicgrid:DynamicSplitPanel>
- </UserControl>
|