示例#1
0
        internal UIView(Application application, string name, UIElement element, Matrix4x4 matrix, Size size)
        {
            this.name                  = name;
            this.application           = application;
            this.matrix                = matrix;
            this.Viewport              = new Rect(0, 0, size.width, size.height);
            this.visibleElements       = new LightList <UIElement>(32);
            this.dummyRoot             = new UIViewRootElement();
            this.dummyRoot.application = application;
            this.dummyRoot.flags      |= UIElementFlags.EnabledFlagSet;
            this.dummyRoot.style       = new UIStyleSet();
            this.dummyRoot.style.Initialize(dummyRoot);
            this.dummyRoot.layoutResult = new LayoutResult();
            this.dummyRoot.layoutResult.Initialize(dummyRoot);
            this.dummyRoot.View     = this;
            this.dummyRoot.children = new LightList <UIElement>(1);

            int count = StyleUtil.InheritedProperties.Count;

            for (int i = 0; i < count; i++)
            {
                dummyRoot.style.inheritedProperties[i] = DefaultStyleValues_Generated.GetPropertyValue((StylePropertyId)i);
            }

            this.dummyRoot.AddChild(element);
            this.sizeChanged = true;
        }
示例#2
0
文件: UIView.cs 项目: veboys/UIForia
 internal UIView(Application application, string name, UIElement element, Matrix4x4 matrix, Size size)
 {
     this.name                   = name;
     this.application            = application;
     this.matrix                 = matrix;
     this.Viewport               = new Rect(0, 0, size.width, size.height);
     this.visibleElements        = new LightList <UIElement>(32);
     this.dummyRoot              = new UIViewRootElement();
     this.dummyRoot.application  = application;
     this.dummyRoot.flags       |= UIElementFlags.EnabledFlagSet;
     this.dummyRoot.style        = new UIStyleSet(dummyRoot);
     this.dummyRoot.layoutResult = new LayoutResult(dummyRoot);
     this.dummyRoot.View         = this;
     this.dummyRoot.children     = new LightList <UIElement>(1);
     this.dummyRoot.AddChild(element);
     this.sizeChanged = true;
 }