From b53bea7ed0a615a23f841c20707d00dbcc32c91b Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 15 Nov 2021 14:08:38 +0200 Subject: PPC. Color Selection Dialog. Disable buttons OK, Validation when select CMYK tab from Catalog, gui changes. --- .../Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs | 9 ++++----- .../PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Controls') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs index 22a0f4825..8b7ea81c5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs @@ -159,11 +159,10 @@ namespace Tango.PPC.Common.Controls private void CollectionFilter_FilterChanged(object sender, EventArgs e) { _findInProcess = true; - //if (CollectionFilter != null ) - //{ - // row.Visibility = CollectionFilter.Filter(row.DataContext) ? Visibility.Visible : Visibility.Collapsed; - // display = row.Visibility == Visibility.Visible; - //} + if (CollectionFilter != null ) + { + renderer.ScrollToFirstFindItem(CollectionFilter); + } _findInProcess = false; } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs index 1f9a42561..9b865c18b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs @@ -11,6 +11,7 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using Tango.BL.Entities; +using Tango.Touch.Components; using Tango.Touch.Controls; namespace Tango.PPC.Common.Controls @@ -363,5 +364,19 @@ namespace Tango.PPC.Common.Controls return _children[index]; } + public void ScrollToFirstFindItem(ICollectionFilter collectionFilter) + { + foreach (var group in _groupItems.Where(x => x.Items.Count > 0).Reverse().ToList()) + { + foreach( var item in group.Items) + { + if(collectionFilter.Filter(item.Item)) + { + _scrollViewer.ScrollToPosition(item.PositionY - _scrollViewer.ActualHeight / 2); + break; + } + } + } + } } } -- cgit v1.3.1