public static HyperlinkButton CreateHyperlinkButton(object content, Uri navigateUri) { var aBtn = new HyperlinkButton() { Content = content, Padding = new Thickness() }; if (navigateUri != null) { aBtn.Click += Uri_Click; InAppNavigator.SetInAppUri(aBtn, navigateUri); ToolTipService.SetToolTip(aBtn, navigateUri.ToString()); } return(aBtn); }
public static Hyperlink CreateHyperlink(string text, Uri navigateUri) { var u = new Hyperlink(); if (navigateUri != null) { u.Click += Uri_Click; InAppNavigator.SetInAppUri(u, navigateUri); ToolTipService.SetToolTip(u, navigateUri.ToString()); } if (text != null) { u.Inlines.Add(new Run { Text = text }); } return(u); }
private static void Uri_Click(object sender, RoutedEventArgs e) { var uri = InAppNavigator.GetInAppUri((DependencyObject)sender); UriHandler.Handle(uri); }