Ejemplo n.º 1
0
		internal void Initialize(Control control)
		{
			if (control == null || Setters.Count > 0)
				return;

			foreach (var setter in xmlNode.ChildNodes.OfType<XmlNode>().Where(x => x.LocalName == "Setter"))
			{
				var propertyName = setter.Attributes["Property"];
				if (propertyName != null && !string.IsNullOrEmpty(propertyName.Value))
				{
					var dp = control.GetDependencyProperty(propertyName.Value);
					if (dp == null)
						continue;

					var valueAttr = setter.Attributes["Value"];
					if (valueAttr == null || string.IsNullOrEmpty(valueAttr.Value))
						continue;

					var value = LoadValue(valueAttr.Value, dp.PropType);

					Setters.Add(dp, value);
				}
			}
		}
Ejemplo n.º 2
0
 public void AddChild(Control child)
 {
     Child = child;
 }
Ejemplo n.º 3
0
 public ContentControl(Control child)
 {
     Child = child;
 }
Ejemplo n.º 4
0
		internal virtual void InvalidateLayout(Control source)
		{
			Size = null;
			Location = null;

			if (this != source)
				return;

			// Now let's invalidate the entire branch of this tree so we can properly recalculate/redraw
			var ctrl = Parent;
			while (ctrl != null)
			{
				ctrl.InvalidateLayout(this);
				ctrl = ctrl.Parent;
			}
		}
Ejemplo n.º 5
0
		public void AddControl(Control control)
		{
			controls.Add(control);
		}
Ejemplo n.º 6
0
		internal void Apply(Control control)
		{
			foreach (var key in Setters.Keys)
				TargetType.GetProperty(key.Name).SetValue(control, Setters[key], null);
		}
Ejemplo n.º 7
0
        internal override void InvalidateLayout(Control source)
        {
            base.InvalidateLayout(source);

            Child.InvalidateLayout(source);
        }
Ejemplo n.º 8
0
 public void AddChild(Control child)
 {
     Child = child;
     child.Parent = this;
 }
Ejemplo n.º 9
0
 public ContentControl(Control child)
 {
     AddChild(child);
 }