I am trying to format a Tweet using Data Binding. What I need to do is split the Text value of the tweet based on what type of content it is.
text = "This is a Tweet with a hyperlink http://www.mysite.com"
I need to add some color formatting to the http://... portion of the text value.
Here's the kicker, I'd like to do this using only XAML Data Binding.
<TextBlock x:Name="Tweet1" FontWeight="Bold" Height="207.236"
LineHeight="55" TextAlignment="Left" TextWrapping="Wrap"
Width="1614.646" Text="{Binding XPath=/statuses/status[2]/text}"
FontSize="56" FontFamily="Segoe Book"
Foreground="{DynamicResource TextColor-Gray}" />
// needs to end up looking like
<TextBlock x:Name="Tweet1" FontWeight="Bold" ... FontSize="56" FontFamily="Segoe Book">
<Run Foreground="{DynamicResource TextColor-Gray}" >This is a Tweet with a hyperlink</Run>
<Run Foreground="{DynamicResource TextColor-Pink}" >http://www.mysite.com</Run>
</TextBlock>
Here is a Regex I could use to split the text value, but I'm trying to use strictly DataBinding.
Regex regUrl = new Regex(@"/http:\/\/\S+/g");
Suggestions?