You can use an attached property:
public class ButtonBehavior
{
public static readonly DependencyProperty UrlLinkProperty =
DependencyProperty.RegisterAttached("UrlLink",
typeof(ButtonBase),
typeof(ButtonBehavior)
new FrameworkPropertyMetadata(null));
public static string GetUrlLink(DependencyObject d)
{
return (string)d.GetValue(UrlLinkProperty);
}
public static void SetUrlLink(DependencyObject d, string value)
{
d.SetValue(UrlLinkProperty, value);
}
}
Then you can declare your button like this:
<Button Tag="BBC World News" ButtonBehavior.UrlLink="http://www.bbc.co.uk" Click="btnArticleView"/>
And you click handler will look like this:
protected void btnArticleView(object sender, RoutedEventArgs e)
{
Button rb = sender as Button;
string TheTitle = rb.Tag.ToString();
string TheURL = ButtonBehavior.GetUrlLink(rb);
// Further code here
}