public UIObjectVM() { _margin = new MarginVM(); wireCommands(); wireProperties(); }
public static MarginVM FromThickness(Thickness t) { MarginVM m = new MarginVM { _bottom = t.Bottom, _top = t.Top, _left = t.Left, _right = t.Right }; return(m); }
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); }
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"))); }