Пример #1
0
        public void HighlightElement(View viewToHighlight, SKCanvasView skCanvasView, Layout <View> formLayout)
        {
            var layoutChildren = formLayout.Children;

            if (_highlightState == null)
            {
                _highlightState = new HighlightState()
                {
                    HighlightPath = HighlightPath.Create(skCanvasView, layoutChildren, _highlightSettings.StrokeWidth)
                };
            }

            var highlightPath       = _highlightState.HighlightPath;
            var currHighlightViewId = _highlightState.CurrHighlightedViewId;
            var iViewIdToHighlight  = highlightPath.GetViewId(layoutChildren, viewToHighlight);

            if (currHighlightViewId == iViewIdToHighlight)
            {
                return;
            }

            var fromDash = currHighlightViewId != -1
                ? _highlightState.StrokeDash
                : new StrokeDash(highlightPath.GetDashForView(layoutChildren, iViewIdToHighlight));

            _highlightState.CurrHighlightedViewId = iViewIdToHighlight;

            var toDash = new StrokeDash(highlightPath.GetDashForView(layoutChildren, viewToHighlight));

            DrawDash(skCanvasView, fromDash, toDash);
        }
Пример #2
0
        public void Invalidate(SKCanvasView skCanvasView, Layout <View> formLayout)
        {
            if (_highlightState == null)
            {
                return;
            }

            var viewToHighlight = _highlightState.HighlightPath.GetView(formLayout.Children, _highlightState.CurrHighlightedViewId);

            _highlightState = null;
            HighlightElement(viewToHighlight, skCanvasView, formLayout);
        }