aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-09-14 13:21:10 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-09-14 13:22:27 +0300
commit38200150dd731b158448316835b069d3fef2bc8f (patch)
treec92f37e863ccaca287056994d9c5d4d6bc3738b1 /Software
parent99c757db6c5d9c67566b8c5ac6b3e5f18cb1010c (diff)
downloadTango-38200150dd731b158448316835b069d3fef2bc8f.tar.gz
Tango-38200150dd731b158448316835b069d3fef2bc8f.zip
Select All in PPC - new icon.
Diffstat (limited to 'Software')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobView/select_all.pngbin0 -> 787 bytes
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj5
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs19
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml22
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs31
5 files changed, 73 insertions, 4 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobView/select_all.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobView/select_all.png
new file mode 100644
index 000000000..0a27c2aaa
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Images/JobView/select_all.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
index 96083d842..33ccc5b53 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Tango.PPC.JobsV2.csproj
@@ -752,10 +752,13 @@
<ItemGroup>
<Resource Include="Images\ColorSelection\SearchImage.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\JobView\select_all.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
index e5e41b382..5f005385e 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobsViewVM.cs
@@ -185,6 +185,16 @@ namespace Tango.PPC.Jobs.ViewModels
set { _collectionFilter = value; RaisePropertyChangedAuto(); }
}
+ private bool _selectAll;
+
+ public bool SelectAll
+ {
+ get { return _selectAll; }
+ set { _selectAll = value;
+ RaisePropertyChangedAuto();}
+ }
+
+
#endregion
@@ -230,6 +240,8 @@ namespace Tango.PPC.Jobs.ViewModels
/// </summary>
public RelayCommand MoveToListJobsCommand { get; set; }
+ public RelayCommand SelectAllJobsCommand { get; set; }
+
#endregion
#region Constructors
@@ -257,6 +269,7 @@ namespace Tango.PPC.Jobs.ViewModels
CloneJobsCommand = new RelayCommand(() => CloneJobs(SelectedJobs));
ExportJobCommand = new RelayCommand(ExportJob);
MoveToListJobsCommand = new RelayCommand(() => MoveToListJobs(SelectedJobs));
+ SelectAllJobsCommand = new RelayCommand(SelectAllJobs);
RegisterForMessage<JobRemovedMessage>(HandleJobRemovedMessage);
RegisterForMessage<JobSavedMessage>(HandleJobSavedMessage);
@@ -421,6 +434,12 @@ namespace Tango.PPC.Jobs.ViewModels
IsMultiSelecting = false;
}
+ private void SelectAllJobs()
+ {
+ SelectAll = !SelectAll;
+ }
+
+
/// <summary>
/// Adds a new job.
/// </summary>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
index d3fdedde5..b57619c8c 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobsView.xaml
@@ -35,6 +35,8 @@
<sharedConverters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
<converters:JobsCategoryToVisibilityConverter x:Key="JobsCategoryToVisibilityConverter" />
<converters:JobsCategoryToOpacityConverter x:Key="JobsCategoryToOpacityConverter" />
+
+ <BitmapImage x:Key="SelectAll" UriSource="../Images/JobView/select_all.png" />
</ResourceDictionary>
</UserControl.Resources>
@@ -94,6 +96,22 @@
<touch:TouchIconButton Command="{Binding ClearSelectionCommand}" Visibility="{Binding IsMultiSelecting,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 0 30 0" Padding="20" Icon="Close" Width="50" Height="50" Style="{StaticResource TangoRoundTouchIconButton}">
</touch:TouchIconButton>
+ <!--<touch:TouchIconButton Command="{Binding SelectAllJobsCommand}" Margin="0 0 30 0" Padding="20" Icon="CheckboxMultipleMarkedOutline" Style="{StaticResource TangoRoundTouchIconButton}">>-->
+ <touch:TouchButton x:Name="SelectAllButton" Command="{Binding SelectAllJobsCommand}" Margin="0 0 30 0" EnableDropShadow="False">
+ <touch:TouchButton.Style>
+ <Style TargetType="touch:TouchButton" >
+ <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter>
+ <Setter Property="RenderOptions.EdgeMode" Value="Unspecified"></Setter>
+ <Setter Property="RenderOptions.BitmapScalingMode" Value="Fant"></Setter>
+ <Setter Property="CornerRadius" Value="50"></Setter>
+ <Setter Property="RippleCentered" Value="True"></Setter>
+ <Setter Property="RippleFactor" Value="2"></Setter>
+ <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter>
+ </Style>
+ </touch:TouchButton.Style>
+ <Image Source="{StaticResource SelectAll}" Width="24" Height="24"></Image>
+ </touch:TouchButton>
+ <!--</touch:TouchIconButton>-->
<touch:TouchIconButton Command="{Binding MoveToListJobsCommand}" Margin="0 0 30 0" Padding="20" >
<touch:TouchIconButton.Style>
<Style TargetType="touch:TouchIconButton" BasedOn="{StaticResource TangoRoundTouchIconButton}">
@@ -205,7 +223,7 @@
<Grid Grid.Row="1" x:Name="moveGrid">
<touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='Draft'}">
- <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" RenderOptions.EdgeMode="Unspecified" Style="{StaticResource TangoJobsGrid}" x:Name="dataGridJobs" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" OnDragAndDropCommand="{Binding JobDragedDroppedCommand}" ItemsSource="{Binding DraftJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10">
+ <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" RenderOptions.EdgeMode="Unspecified" Style="{StaticResource TangoJobsGrid}" x:Name="dataGridJobs" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" OnDragAndDropCommand="{Binding JobDragedDroppedCommand}" ItemsSource="{Binding DraftJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10" SelectAll="{Binding SelectAll,Mode=TwoWay}">
<touch:LightTouchDataGrid.Columns>
<!--<touch:LightTouchDataGridColumn Width="90">
<touch:LightTouchDataGridColumn.Header>
@@ -336,7 +354,7 @@
</touch:TouchLoadingPanel>
<touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='History'}">
- <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" EnableDragAndDrop="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10">
+ <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" EnableDragAndDrop="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10" SelectAll="{Binding SelectAll,Mode=TwoWay}">
<touch:LightTouchDataGrid.Columns>
<touch:LightTouchDataGridColumn Width="50">
<touch:LightTouchDataGridColumn.Header>
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs
index 4ec74caf8..838f68211 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs
+++ b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs
@@ -168,6 +168,15 @@ namespace Tango.Touch.Controls
public static readonly DependencyProperty CollectionFilterProperty =
DependencyProperty.Register("CollectionFilter", typeof(ICollectionFilter), typeof(LightTouchDataGrid), new PropertyMetadata(null, (d, e) => (d as LightTouchDataGrid).OnCollectionFilterChanged()));
+ public bool SelectAll
+ {
+ get { return (bool)GetValue(SelectAllProperty); }
+ set { SetValue(SelectAllProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty SelectAllProperty =
+ DependencyProperty.Register("SelectAll", typeof(bool), typeof(LightTouchDataGrid), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (d, e) => (d as LightTouchDataGrid).OnSelectedAllChanged()));
#endregion
#region Commands
@@ -412,6 +421,27 @@ namespace Tango.Touch.Controls
}
}
+ private void OnSelectedAllChanged()
+ {
+ if (IsMultiSelecting)
+ {
+ if (SelectAll)
+ {
+ foreach (var row in GetRows())
+ {
+ row.IsSelected = true;
+
+ }
+ UpdateSelectedItems();
+ }
+ else
+ {
+ ClearSelectedItems();
+ }
+ }
+ }
+
+
#endregion
#region Command Handlers
@@ -527,7 +557,6 @@ namespace Tango.Touch.Controls
CollectionFilter.FilterChanged += CollectionFilter_FilterChanged;
}
}
-
#endregion
#region Public Methods