<Window x:Class="DesktopMagic.PluginWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:DesktopMagic"
        mc:Ignorable="d"
        Title="PluginWindow" Height="450" Width="800"
        Background="Transparent"
        WindowStyle="None"
        AllowsTransparency="True"
        LocationChanged="Window_LocationChanged"
        SizeChanged="Window_SizeChanged"
        Closing="Window_Closing"
        ContentRendered="Window_ContentRendered"
        x:Name="window">
    <Grid>
        <Rectangle x:Name="panel" Fill="#4CBAFFEF" Stroke="White" Margin="0,0,0,0" Visibility="Collapsed" />

        <Border SizeChanged="Border_SizeChanged" x:Name="border" />
        <Viewbox SizeChanged="ViewBox_SizeChanged" x:Name="viewBox" StretchDirection="Both" Stretch="Uniform">
            <Viewbox.Clip>
                <RectangleGeometry x:Name="rectangleGeometry" RadiusX="{Binding ElementName=border, Path=CornerRadius.TopLeft}" RadiusY="{Binding ElementName=border, Path=CornerRadius.TopLeft}" />
            </Viewbox.Clip>
            <Border x:Name="imageBorder" BorderBrush="#BAFFEF">
                <Image x:Name="image" RenderOptions.EdgeMode="Aliased" Margin="0,0,0,0" VerticalAlignment="Top"  RenderTransformOrigin="0.5,0.5" Stretch="Uniform" MouseDown="Window_MouseDown" MouseMove="Window_MouseMove" MouseWheel="Window_MouseWheel" />
            </Border>
        </Viewbox>
    </Grid>
    <WindowChrome.WindowChrome>
        <WindowChrome x:Name="tileBar" CaptionHeight="30" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
    </WindowChrome.WindowChrome>
</Window>