diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-02 16:42:20 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-02 16:42:20 +0300 |
| commit | 64dde680dcf7cb0c3876aea32134c3324459e94e (patch) | |
| tree | 2124bd7ee6620756c44ab7c68b56aad8f7d29727 /Software/Visual_Studio/PPC/Tango.PPC.Common/Controls | |
| parent | d866652d38d2366c333a1ff5092aff1cc4b85dfa (diff) | |
| download | Tango-64dde680dcf7cb0c3876aea32134c3324459e94e.tar.gz Tango-64dde680dcf7cb0c3876aea32134c3324459e94e.zip | |
Implemented some relief for TwineCatalogControl on scrolling changes..
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Controls')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs | 18 |
1 files changed, 12 insertions, 6 deletions
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 2b376e855..d28bbff72 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 @@ -24,6 +24,7 @@ namespace Tango.PPC.Common.Controls private Catalog _catalog; private bool _loaded; private bool _preventChange; + private double _lastScrollPosition = 0; public CatalogItem SelectedItem { @@ -45,14 +46,19 @@ namespace Tango.PPC.Common.Controls { if (!_preventChange) { - var group = list.ScrollViewer.GetMostVisibleElementDataContext<CatalogGroup>(); - - if (group != null) + if (e.Value > _lastScrollPosition + 10 || e.Value < _lastScrollPosition - 10) { - _preventChange = true; - slider.Value = slider.Maximum - _catalog.Groups.IndexOf(group); - _preventChange = false; + var group = list.ScrollViewer.GetMostVisibleElementDataContext<CatalogGroup>(); + + if (group != null) + { + _preventChange = true; + slider.Value = slider.Maximum - _catalog.Groups.IndexOf(group); + _preventChange = false; + } } + + _lastScrollPosition = e.Value; } } |
