From 38200150dd731b158448316835b069d3fef2bc8f Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 14 Sep 2023 13:21:10 +0300 Subject: Select All in PPC - new icon. --- .../Tango.Touch/Controls/LightTouchDataGrid.cs | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.Touch') 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 -- cgit v1.3.1