VisualBrush Binding to a Button : VisualBrush « Windows Presentation Foundation « C# / CSharp Tutorial






<Window x:Class="Drawing.VisualBrush"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="VisualBrush" Height="300" Width="300"
    >
  <StackPanel Margin="3">
    <Button Name="cmd" Margin="3" Padding="5">Is this a real button?</Button>
    <Rectangle Margin="3" Height="{Binding ElementName=cmd,Path=ActualHeight}">
      <Rectangle.Fill>
        <VisualBrush Visual="{Binding ElementName=cmd}"></VisualBrush>
      </Rectangle.Fill>
    </Rectangle>
    <Rectangle Margin="3" Height="50">
      <Rectangle.Fill>
        <VisualBrush Visual="{Binding ElementName=cmd}"></VisualBrush>
      </Rectangle.Fill>
    </Rectangle>
    <Rectangle Margin="3" Height="150">
      <Rectangle.Fill>
        <VisualBrush Visual="{Binding ElementName=cmd}"></VisualBrush>
      </Rectangle.Fill>
    </Rectangle>
  </StackPanel>
</Window>
WPF Visual Brush Binding To A Button








24.95.VisualBrush
24.95.1.Tiled VisualBrushTiled VisualBrush
24.95.2.VisualBrush and DrawingBrushVisualBrush and DrawingBrush
24.95.3.Simulating a reflection with VisualBrushSimulating a reflection with VisualBrush
24.95.4.Visual Brush For a RectangleVisual Brush For a Rectangle
24.95.5.Use VisualBrush to paint backgroundUse VisualBrush to paint background
24.95.6.Tile VisualBrushTile VisualBrush
24.95.7.VisualBrush Binding to a ButtonVisualBrush Binding to a Button
24.95.8.Gradient brushes within a DrawingBrushGradient brushes within a DrawingBrush