Hi everyone, I'm an experienced C# developer but a WPF newbie. Basic question (I think) that I can't find an answer to by web searching. Here's the simplified use case...
I want to display a string in a WPF TextBlock. So I write some C# code in codebehind of my XAML control...
public class MyCoolControl : UserControl
{
public void InitializeMyCoolControl()
{
this.DataContext = "SomeStringOnlyAvailableAtRuntime"; // Perhaps from a database or something...
}
}
And I set up my XAML like this:
<UserControl ... snip...>
<!-- Bind the textblock to whatever's in the DataContext -->
<TextBlock Text="{Binding}"></TextBlock>
</UserControl>
Works great, I can see the value "SomeStringOnlyAvailableAtRuntime" when I execute my application. However, I don't see anything at Design Time using Visual Studio 2008's XAML Designer.
How can I see a placeholder value (anything) for the textblock at design time?
Thanks!
-Mike