<UserControl x:Class="BindingMemoryLeak.BindingMemoryLeakMainView"
  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"
  mc:Ignorable="d"
  xmlns:local="clr-namespace:BindingMemoryLeak"
  d:DataContext="{d:DesignInstance local:ViewModel}">
    <UserControl.Resources>
        <ResourceDictionary>
            <local:TrainingConverter x:Key="TrainingConverter"/>
        </ResourceDictionary>
    </UserControl.Resources> 
    <Border Background="DodgerBlue" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="50,20">
    <StackPanel>
      <TextBlock Text="Hello World" FontSize="30" Foreground="White"/>
      <Viewbox Height="147" Width="260" Stretch="Fill" Margin="-2 0 -1 0 ">
          <Grid>
              <Image Height="648" Width="1296" x:Name="SessionImage" Source="{Binding TrainingId, Converter={StaticResource TrainingConverter}, ConverterParameter=true}" Stretch="UniformToFill"/>
              <Rectangle x:Name="ImageMask" Height="648" Width="1296" Fill="Gray" Opacity="0.5" Visibility="Hidden"/>
          </Grid>
      </Viewbox>
      <Button Content="Select Random Training" Margin="0,10,0,0"
              Command="{Binding RandomizeTraining}"/>
    </StackPanel>
  </Border>
</UserControl>
