Example #1
0
        public UIObjectVM()
        {
            _margin = new MarginVM();

            wireCommands();
            wireProperties();
        }
Example #2
0
        public static MarginVM FromThickness(Thickness t)
        {
            MarginVM m = new MarginVM
            {
                _bottom = t.Bottom,
                _top    = t.Top,
                _left   = t.Left,
                _right  = t.Right
            };

            return(m);
        }
Example #3
0
        public static MarginVM FromString(string str)
        {
            var      values = str.Split(';');
            MarginVM retVal = new MarginVM();

            try { retVal.Left = values[0].ToDouble(); }
            catch (Exception) { }
            try { retVal.Top = values[1].ToDouble(); }
            catch (Exception) { }
            try { retVal.Right = values[2].ToDouble(); }
            catch (Exception) { }
            try { retVal.Bottom = values[3].ToDouble(); }
            catch (Exception) { }
            return(retVal);
        }
Example #4
0
        public ContainerVM()
        {
            _children = new ObservableCollection <UIObjectVM>();

            _backgroundColor = Colors.Transparent;
            _borderColor     = Colors.Transparent;
            _padding         = new MarginVM();

            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("Padding")));
            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("BorderThickness")));
            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("BorderColor")));
            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("CornerRadius")));
            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("BackgroundColor")));
            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("VerticalScrollEnabled")));
            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("HorizontalScrollEnabled")));
            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("ContentWidth")));
            properties.Add(new PropertyWrapper(this, typeof(ContainerVM).GetProperty("ContentHeight")));
        }