예제 #1
0
 public bool IsIn(UIFrame frame)
 {
     return
         (x > frame.x &&
          y > frame.y &&
          x < (frame.x + frame.width) &&
          y < (frame.y + frame.height));
 }
예제 #2
0
        public View UpdateAttributesUI(ComosWebSDK.UI.UIFrame frame)
        {
            if (frame.Children == null || frame.Children.Length == 0)
            {
                return(null);
            }

            Frame f = new Frame()
            {
                BackgroundColor = (Color)App.Current.Resources["ComosColorModuleCard"],
                OutlineColor    = (Color)App.Current.Resources["ComosColorNavBar"],
                CornerRadius    = 8,
                VerticalOptions = LayoutOptions.FillAndExpand,
            };
            //AbsoluteLayout.SetLayoutBounds(f, new Rectangle(
            //    frame.x, frame.y, frame.width, frame.height));
            StackLayout stack = new StackLayout();

            if (frame.Children != null)
            {
                var lbl = new Label()
                {
                    Text           = frame.Text,
                    FontAttributes = FontAttributes.Bold
                };
                lbl.SetDynamicResource(Label.TextColorProperty, "ComosColorNavBar");
                stack.Children.Add(lbl);
                foreach (var c in frame.Children)
                {
                    var childview = UpdateAttributesUI(c);
                    if (childview != null)
                    {
                        stack.Children.Add(childview);
                    }
                }
            }

            if (stack.Children.Count == 1)
            {
                return(null);
            }

            f.Content = stack;

            return(f);
        }