App.xaml
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
StartupUri="MainWindow.xaml"
/>
MainWindow.xaml
<Window
xClass="HelloWorld.MainWindow"
xmlnsx="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="Hello World"
>
<StackPanel>
<Button Width="100" Height="20" xName="button">テスト</Button>
<Rectangle Width="500" Height="300">
<RectangleFill>
<VisualBrush
Visual="{Binding ElementName=button}"
Viewport="0, 0, 0.5, 0.25"
TileMode="Tile" />
</RectangleFill>
</Rectangle>
</StackPanel>
</Window>
アプリ実行