![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | VisualBrush of an expander.. Problem: When I create a visualbrush of (an initially) collapsed Expander (with no explicit Height set) The "first" render of the visualbrush will render the header only. After I expanded and collapsed the expander back. The visualbrush renders the header AND the whitespace the Expander control took when it was expanded. It "remembers" the height someway. Is there a way that the visualbrush only renders the header again? I prepared a little test xaml to show the problem. Just expand and collapse the Expander. The rectangle will be different from the original one. <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xml:lang="en-US" x:Class="testvisualbrush.Window1" x:Name="Window" Title="Window" Width="400" Height="200"> <Canvas> <Expander Canvas.Top="0" Width="300" Name="exp" Background="#FFFF8B00"> <Expander.Header>Header</Expander.Header> <Label>Content </Label> </Expander> <Rectangle Canvas.Top="50" Stroke="#FF000000" Width="300" Height="100"> <Rectangle.Fill> <VisualBrush><VisualBrush.Visual> <Binding ElementName="exp" /> </VisualBrush.Visual></VisualBrush> </Rectangle.Fill> </Rectangle> </Canvas> </Window> |
My System Specs![]() |