public void SetProperty(LayoutPartPropertyName property, object value) { switch (property) { case LayoutPartPropertyName.Title: Title = value.ToString(); break; case LayoutPartPropertyName.BackgroundColor: BackgroundColor = Utils.Cast<Color>(value); break; case LayoutPartPropertyName.BorderColor: BorderColor = Utils.Cast<Color>(value); break; case LayoutPartPropertyName.BorderThickness: BorderThickness = Utils.Cast<int>(value); break; case LayoutPartPropertyName.Margin: Margin = Utils.Cast<int>(value); break; default: if (Content is ILayoutPartControl) ((ILayoutPartControl)Content).SetProperty(property, value); break; } }
public object GetProperty(LayoutPartPropertyName property) { switch (property) { case LayoutPartPropertyName.Title: return Title; case LayoutPartPropertyName.BackgroundColor: return BackgroundColor; case LayoutPartPropertyName.BorderColor: return BorderColor; case LayoutPartPropertyName.BorderThickness: return BorderThickness; case LayoutPartPropertyName.Margin: return Margin; default: return Content is ILayoutPartControl ? ((ILayoutPartControl)Content).GetProperty(property) : null; } }
public object GetProperty(LayoutPartPropertyName property) { return property == LayoutPartPropertyName.Text ? Text : null; }
public void SetProperty(LayoutPartPropertyName property, object value) { if (property == LayoutPartPropertyName.Text) Text = value.ToString(); }
public LayoutPartProperty(LayoutPartPropertyAccess access, Type type, LayoutPartPropertyName name) { Access = access; Type = type; Name = name; }