Guest User

Untitled

a guest
Jun 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <TextBlock >
  2. <Hyperlink NavigateUri="{Binding Url, ElementName=root}" >
  3. <TextBlock Text="{Binding Text, ElementName=root}" />
  4. </Hyperlink>
  5. </TextBlock>
  6.  
  7. public static readonly DependencyProperty UrlProperty = DependencyProperty.Register("Url", typeof (string), typeof (LinkTextBlock));
  8. public string Url
  9. {
  10. get { return (string) GetValue(UrlProperty); }
  11. set { SetValue(UrlProperty, value); }
  12. }
  13. public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof (string), typeof (LinkTextBlock));
  14. public string Text
  15. {
  16. get { return (string) GetValue(TextProperty); }
  17. set { SetValue(TextProperty, value); }
  18. }
  19.  
  20. <Controls:LinkTextBlock Text="{Binding Email}" Url="{Binding Email}" />
  21.  
  22. <TextBlock >
  23. <Hyperlink NavigateUri="{Binding Url, ElementName=root}" >
  24. <TextBlock Text="{Binding Text, ElementName=root}" />
  25. </Hyperlink>
  26. </TextBlock>
  27.  
  28. <TextBlock Text="{Binding Text, ElementName=root}">
  29. <Hyperlink NavigateUri="{Binding Url, ElementName=root}" />
  30. </TextBlock>
Add Comment
Please, Sign In to add comment