VoodooChild
VoodooChild

Reputation: 9784

Siliverlight: controls visibility changes alignment?

The following code

    <StackPanel Orientation="Horizontal">
        <Image Source="test.jpg"/>
        <Image Source="test2.jpg"/>
        <TextBlock Text="TeStBlock"/>
    </StackPanel>

If I am setting the visibility of the contents of the StackPanel in the codebehind and lets say I set the visibility of the Second image to collapsed. I notice that the TextBlock moves to where the Image used to be.

How can I keep the alignment and turn the visibility on or off?

Upvotes: 2

Views: 76

Answers (1)

AnthonyWJones
AnthonyWJones

Reputation: 189487

Use Opacity="0" instead.

Upvotes: 2

Related Questions