Sunday, August 14, 2005
Using VisualBrush
Essentially, here is the bag:
   -Brush
         -GradientBrush
               -LinearGradientBrush
               -RadialGradientBrush
         -SolidColorBrush
         -TileBrush
               -DrawingBrush
               -ImageBrush
               -VisualBrush
 
This VisualBrush allows you to turn a UIElement (Control) into a brush and render it onto anything (since it is a brush)...
<StackPanel>
         <StackPanel.LayoutTransform>
                  <ScaleTransform Center="0,0" ScaleX="6" ScaleY="6" />
         </StackPanel.LayoutTransform>
         <Button Style="{StaticResource ButtonStyle}" Name="button1">
                  <Button.Content>Hello</Button.Content>
         </Button>
         <Button Name="button2" Click="Button2Click">
                  <Button.Content>2</Button.Content>
         </Button>
         <Button Name="button3" Background="Green">
                  <Button.Content>3</Button.Content>
         </Button>
</StackPanel>
private void Button2Click(object sender, RoutedEventArgs e)
{
         VisualBrush brush = new VisualBrush(this.button1);
         this.button2.Background = brush;
}
                               more...
http://www.sebura.com
Originally Posted on 8/14/2005 8:12:54 AMContent source: http://longhornblogs.com/rdawson/archive/2005/05/26/14130.aspx
   -Brush
         -GradientBrush
               -LinearGradientBrush
               -RadialGradientBrush
         -SolidColorBrush
         -TileBrush
               -DrawingBrush
               -ImageBrush
               -VisualBrush
 
This VisualBrush allows you to turn a UIElement (Control) into a brush and render it onto anything (since it is a brush)...
<StackPanel>
         <StackPanel.LayoutTransform>
                  <ScaleTransform Center="0,0" ScaleX="6" ScaleY="6" />
         </StackPanel.LayoutTransform>
         <Button Style="{StaticResource ButtonStyle}" Name="button1">
                  <Button.Content>Hello</Button.Content>
         </Button>
         <Button Name="button2" Click="Button2Click">
                  <Button.Content>2</Button.Content>
         </Button>
         <Button Name="button3" Background="Green">
                  <Button.Content>3</Button.Content>
         </Button>
</StackPanel>
private void Button2Click(object sender, RoutedEventArgs e)
{
         VisualBrush brush = new VisualBrush(this.button1);
         this.button2.Background = brush;
}
                               more...
http://www.sebura.com
Originally Posted on 8/14/2005 8:12:54 AMContent source: http://longhornblogs.com/rdawson/archive/2005/05/26/14130.aspx