Пример #1
0
        private RegionWidgetState(RegionWidget widget)
        {
            Verify.Argument.IsNotNull(widget, nameof(widget));

            Widget       = widget;
            RegionBounds = widget.RegionBounds;
            var vertices = new List <VertexState>();

            foreach (var vertex in widget.Children.OfType <VertexWidget>())
            {
                vertices.Add(new VertexState(vertex));
            }
            Vertices = vertices;
        }
Пример #2
0
 public static RegionWidgetState TryCapture(RegionWidget widget)
 {
     return(widget != null && !widget.RegionBounds.IsEmpty ? new RegionWidgetState(widget) : null);
 }