AVEVA OMI Software Developer Kit
Touch in the NavTreeControl

You can extract code from the NavTreeControl or the NavBreadcrumbControl and use it as a module within your app to support touch manipulation gestures, such as touch up and down, and for converting touch to mouse, for example, a tap to a mouse click. This is set by the Boolean property ConvertToMouse. The controls include code for processing swipes and other touch manipulations. For example, you can convert a down gesture to scroll up a drop down list, as shown below:

case TouchType.ManipulationDelta:
                    if (touchArgs is ManipulationTouchArgs manipulationArgs)
                    {
                        if (touchArgs.InteractionMode == InteractionMode.SystemMode)
                        {
                            if (manipulationArgs.Delta != null && (touchArgs.TouchPointsCount == 1 || manipulationArgs.IsInertia) && this.swipestarted)
                            {
                                var scrollViewer = (touchArgs.Sender as Popup)?.Child.FindChildOfType<ScrollViewer>();
                                var direction = TouchUtil.GetGestureDirection(manipulationArgs.Cumulative);
                                var deltaX = manipulationArgs.Delta.Translation.X;
                                var deltaY = manipulationArgs.Delta.Translation.Y;
                                Logger.LogCustom(CustomLogFlags.ProcessGesture, () => $"ManipulationDelta, deltaX = {deltaX}, deltaY = {deltaY}");
                                if (direction == GestureDirection.Down || direction == GestureDirection.Up)
                                {
                                     ScrollViewerHelper.ScrollToVerticalOffset(scrollViewer, -deltaY);
                                }
                                if (direction == GestureDirection.Left || direction == GestureDirection.Right)
                                {
                                   ScrollViewerHelper.ScrollToHorizontalOffset(scrollViewer, -deltaX);
                                }
                                result.Handled = true;
                            }
                        }

The full path names for these navigation controls are:

  • <root installation directory>:\Program Files (x86)\ArchestrA\Framework\AcfSdk\Samples\NavTree\View\NavTreeControl.xaml.cs
  • <root installation directory>:\Program Files (x86)\ArchestrA\Framework\AcfSdk\Samples\NavBreadcrumb\NavBreadcrumbControl.xaml.cs