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?
You can change the
Backgroundof theTextBlockto something visible enough if it’s the same color as the visuals behind it, and setHorizontalAlignmentto “Stretch”. This way it will fill the available width. That, or set theMinWidthto an explicit number. No text, but it will be visible.