internal void SetParent(LabelProperties parentLabelProperties)
 {
     FieldInfo[] fields = this.GetType().GetFields();
     foreach (FieldInfo field in fields)
     {
         DependencyProperty dp               = (DependencyProperty)field.GetValue(this);
         DependencyProperty dpTextblock      = (DependencyProperty)(parentLabelProperties.GetType().GetField(string.Concat(dp.Name, "Property")).GetValue(parentLabelProperties));
         Binding            bindingTransform = new Binding(dp.Name);
         bindingTransform.Source = parentLabelProperties;
         bindingTransform.Mode   = BindingMode.OneWay;
         BindingOperations.SetBinding(this, dpTextblock, bindingTransform);
     }
 }
Example #2
0
 internal void SetParent(LabelProperties parentLabelProperties)
 {
     FieldInfo[] fields = this.GetType().GetFields();
     foreach (FieldInfo field in fields)
     {
         DependencyProperty dp = (DependencyProperty)field.GetValue(this);
         DependencyProperty dpTextblock = (DependencyProperty)(parentLabelProperties.GetType().GetField(string.Concat(dp.Name, "Property")).GetValue(parentLabelProperties));
         Binding bindingTransform = new Binding(dp.Name);
         bindingTransform.Source = parentLabelProperties;
         bindingTransform.Mode = BindingMode.OneWay;
         BindingOperations.SetBinding(this, dpTextblock, bindingTransform);
     }
 }