Advertisement
Guest User

Untitled

a guest
May 29th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. XAML:
  2.         <Image Source="{Binding ElementName=DockItemControl, Path=TestProp}" x:Name="img"/>
  3.  
  4. Code-Behind:
  5.         public String TestProp
  6.         {
  7.             get { return (String)GetValue(TestPropProperty); }
  8.             set { SetValue(TestPropProperty, value); }
  9.         }
  10.  
  11.         public static readonly DependencyProperty TestPropProperty =
  12.             DependencyProperty.Register("TestProp", typeof(String), typeof(DockItem), new UIPropertyMetadata(0));
  13.  
  14.  
  15.  
  16. Window-Code:
  17.         <local:DockItem HorizontalAlignment="Left" TestProp="Test"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement