Gradient brushes within a DrawingBrush

image_pdfimage_print


   
     

<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
      <Rectangle Width="50" Height="50" Grid.Row="2" Grid.Column="1">
        <Rectangle.Fill>
          <VisualBrush>
            <VisualBrush.Visual>
              <StackPanel Background="White">
                <Button Margin="1">A Button</Button>
                <Button Margin="1">Another Button</Button>
              </StackPanel>
            </VisualBrush.Visual>
          </VisualBrush>
        </Rectangle.Fill>
      </Rectangle>

</Window>