design time usercontrols - I can't see anything!

Posted by taglius on Stack Overflow See other posts from Stack Overflow or by taglius
Published on 2009-08-04T19:50:00Z Indexed on 2010/04/21 1:03 UTC
Read the original article Hit count: 340

Filed under:
|
|

newbie question, please forgive...

I'm developing a Wpf UserControl that will eventually be bound to a business object. The usercontrol is little more than a series of laid out TextBlocks, and perhaps (later) an image or two.

As I'm laying out the usercontrol, I can put dummy text into all the TextBlocks so I can see what the usercontrol will look like, but as soon as I change the text property to contain the Binding information:

<TextBlock Margin="0,12.8,42,0" Name="lblLastName" 
       FontSize="8" Height="19" 
       VerticalAlignment="Top" 
       Text="{Binding Mode=OneWay, Path=LastName}"/>

Then I can no longer see the textbox, or any "placeholder" text. This makes it very difficult to adjust the location and sizes of all the controls on the UserControl. In WinFormas programming, you could set binding information independently of the Text property, so you could at least see the Placeholder text during design time development. It's going to be pretty hard to visually arrange a bunch of invisible TextBlocks! What's the standard solution for this?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about xaml