Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My other answer is becoming obsolete as you elaborate on your desired behavior, so forgive me for posting a second. Based on my latter comments on the above answer, consider the following example:</p> <pre><code>&lt;Canvas x:Name="LayoutRoot"&gt; &lt;Grid x:Name="MarqueePanels"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Rectangle Grid.Column="0" Height="{Binding ElementName=PrimaryMarquee, Path=ActualHeight}" Width="{Binding ElementName=PrimaryMarquee, Path=ActualWidth}"&gt; &lt;Rectangle.Fill&gt; &lt;VisualBrush Visual="{Binding ElementName=PrimaryMarquee}"/&gt; &lt;/Rectangle.Fill&gt; &lt;/Rectangle&gt; &lt;StackPanel Grid.Column="1" x:Name="PrimaryMarquee"&gt; &lt;TextBlock Text="Marquee Item 1"/&gt; &lt;TextBlock Text="Marquee Item 2"/&gt; &lt;TextBlock Text="Marquee Item 3"/&gt; &lt;/StackPanel&gt; &lt;Rectangle Grid.Column="2" Height="{Binding ElementName=PrimaryMarquee, Path=ActualHeight}" Width="{Binding ElementName=PrimaryMarquee, Path=ActualWidth}"&gt; &lt;Rectangle.Fill&gt; &lt;VisualBrush Visual="{Binding ElementName=PrimaryMarquee}"/&gt; &lt;/Rectangle.Fill&gt; &lt;/Rectangle&gt; &lt;/Grid&gt; &lt;/Canvas&gt; </code></pre> <p>As I mentioned above, setting the <code>Visibility</code> of any of the <code>TextBox</code> elements to <code>Hidden</code> will not cause the <code>StackPanel</code> parent to resize, however using <code>Visibility.Collapsed</code> WILL force an <code>Arrange</code> pass of the parent panel. So if you truly NEED to use a <code>StackPanel</code> to contain the visual elements, then I recommend based on your comments above using <code>Visibility.Hidden</code> in lieu of <code>Visibility.Collapsed</code>.</p> <p>Also notice the use of <code>VisualBrush</code> to replicate the Marquee content. This will simplify the code, and ensure that all 3 visuals always match (with the exception of whatever positioning or transformation you apply to the <code>Rectangle</code> objects that house the <code>VisualBrush</code>).</p> <p>Additionally, I should say that I personally would use a <code>Canvas</code> in lieu of the <code>StackPanel</code>, as the <code>Canvas</code> is much better suited for absolute positioning of child elements, hence the reason for your question.</p> <p>Craig, I truly hope this helps. I (like most people on here) will try to help however I can. Good luck!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload