]> granicus.if.org Git - handbrake/commitdiff
WinGui: Various improvements and fixes to the new summary tab. Revert tab order chang...
authorsr55 <sr55.hb@outlook.com>
Sat, 26 Aug 2017 20:03:04 +0000 (21:03 +0100)
committersr55 <sr55.hb@outlook.com>
Sat, 26 Aug 2017 20:03:39 +0000 (21:03 +0100)
win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/SummaryView.xaml
win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs

index 802eae0b4333c01e64c5a4892d0084588c74f7dc..9cdce00b9e717da3e33456ae97a281090f24495a 100644 (file)
@@ -19,7 +19,7 @@ namespace HandBrakeWPF.Properties {
     // class via a tool like ResGen or Visual Studio.\r
     // To add or remove a member, edit your .ResX file then rerun ResGen\r
     // with the /str option, or rebuild your VS project.\r
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]\r
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]\r
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
     public class ResourcesUI {\r
@@ -817,7 +817,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Picture.\r
+        ///   Looks up a localized string similar to Dimensions.\r
         /// </summary>\r
         public static string MainView_PictureTab {\r
             get {\r
@@ -2411,6 +2411,15 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to No Source.\r
+        /// </summary>\r
+        public static string SummaryView_NoSource {\r
+            get {\r
+                return ResourceManager.GetString("SummaryView_NoSource", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to No Subtitle Tracks.\r
         /// </summary>\r
@@ -2420,6 +2429,15 @@ namespace HandBrakeWPF.Properties {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to No Tracks.\r
+        /// </summary>\r
+        public static string SummaryView_NoTracks {\r
+            get {\r
+                return ResourceManager.GetString("SummaryView_NoTracks", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Preview {0} of {1}.\r
         /// </summary>\r
index 27a3a055ed927074e01d9c8f4747b6eb4ceec5cc..98b46afe93b92481b08d4c1c5a03f0855b063ec9 100644 (file)
     <value>Pause</value>\r
   </data>\r
   <data name="MainView_PictureTab" xml:space="preserve">\r
-    <value>Picture</value>\r
+    <value>Dimensions</value>\r
   </data>\r
   <data name="MainView_Presets" xml:space="preserve">\r
     <value>Presets</value>\r
@@ -971,4 +971,10 @@ This will not affect your current settings in the Subtitle tab.</value>
   <data name="SummaryView_PreviewInfo" xml:space="preserve">\r
     <value>Preview {0} of {1}</value>\r
   </data>\r
+  <data name="SummaryView_NoSource" xml:space="preserve">\r
+    <value>No Source</value>\r
+  </data>\r
+  <data name="SummaryView_NoTracks" xml:space="preserve">\r
+    <value>No Tracks</value>\r
+  </data>\r
 </root>
\ No newline at end of file
index 10f53517fc89e2fda757a71ecd0e6f162470f3e8..a65fca5ebfae129979fd5018d7169827c4055890 100644 (file)
@@ -17,6 +17,7 @@ namespace HandBrakeWPF.ViewModels
     using System.Text;
     using System.Windows.Media.Imaging;
 
+    using HandBrake.ApplicationServices.Interop;
     using HandBrake.ApplicationServices.Interop.Model.Encoding;
 
     using HandBrakeWPF.EventArgs;
@@ -44,6 +45,10 @@ namespace HandBrakeWPF.ViewModels
         private bool isMkv;
         private int selectedPreview = 2;
 
+        private bool isPreviousPreviewControlVisible;
+
+        private bool isNextPreviewControlVisible;
+
         public SummaryViewModel(IScan scanService, IUserSettingService userSettingService)
         {
             this.scanService = scanService;
@@ -126,6 +131,8 @@ namespace HandBrakeWPF.ViewModels
 
         public BitmapImage PreviewImage { get; set; }
         public bool PreviewNotAvailable { get; set; }
+        public int MaxWidth { get; set; }
+        public int MaxHeight { get; set; }
 
         public string VideoTrackInfo { get; set; }
         public string AudioTrackInfo { get; set; }
@@ -136,11 +143,38 @@ namespace HandBrakeWPF.ViewModels
         public string DimensionInfo { get; set; }
         public string AspectInfo { get; set; }
 
-        public bool IsPreviousPreviewControlVisible { get; set; } = false;
-        public bool IsNextPreviewControlVisible { get; set; } = false;
-        public bool IsPreviewInfoVisible { get; set; } = false;
+
+        public bool IsPreviewInfoVisible { get; set; }
         public string PreviewInfo { get; set; }
 
+        public bool IsPreviousPreviewControlVisible
+        {
+            get
+            {
+                return this.isPreviousPreviewControlVisible;
+            }
+            set
+            {
+                if (value == this.isPreviousPreviewControlVisible) return;
+                this.isPreviousPreviewControlVisible = value;
+                this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
+            }
+        }
+
+        public bool IsNextPreviewControlVisible
+        {
+            get
+            {
+                return this.isNextPreviewControlVisible;
+            }
+            set
+            {
+                if (value == this.isNextPreviewControlVisible) return;
+                this.isNextPreviewControlVisible = value;
+                this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
+            }
+        }
+
         #endregion
 
         #region Task Properties 
@@ -303,7 +337,6 @@ namespace HandBrakeWPF.ViewModels
             if (this.selectedPreview == maxPreview)
             {
                 this.IsNextPreviewControlVisible = false;
-                this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
             }
         }
 
@@ -318,7 +351,6 @@ namespace HandBrakeWPF.ViewModels
             if (this.selectedPreview == 1)
             {
                 this.IsPreviousPreviewControlVisible = false;
-                this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
             }
         }
 
@@ -341,9 +373,6 @@ namespace HandBrakeWPF.ViewModels
             {
                 this.IsNextPreviewControlVisible = false;
             }
-
-            this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
-            this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
         }
 
         #region Private Methods
@@ -477,7 +506,7 @@ namespace HandBrakeWPF.ViewModels
                 filters.Add(ResourcesUI.SummaryView_Rotation);
             }
 
-            return string.Join(", ", filters).Trim();
+            return string.Join(", ", filters).TrimEnd(',').Trim();
         }
 
         private string GetAudioDescription()
@@ -492,13 +521,17 @@ namespace HandBrakeWPF.ViewModels
             if (this.Task.AudioTracks.Count >= 1)
             {
                 AudioTrack track1 = this.Task.AudioTracks[0];
-                desc.AppendLine(string.Format("{0}, {1}", EnumHelper<AudioEncoder>.GetDisplay(track1.Encoder), track1.MixDown));
+                HBMixdown mixdownName = HandBrakeEncoderHelpers.GetMixdown(track1.MixDown);
+                string mixdown = mixdownName != null ? ", " + mixdownName.DisplayName : string.Empty;
+                desc.AppendLine(string.Format("{0}{1}", EnumHelper<AudioEncoder>.GetDisplay(track1.Encoder), mixdown));
             }
 
             if (this.Task.AudioTracks.Count >= 2)
             {
                 AudioTrack track2 = this.Task.AudioTracks[1];
-                desc.AppendLine(string.Format("{0}, {1}", EnumHelper<AudioEncoder>.GetDisplay(track2.Encoder), track2.MixDown));
+                HBMixdown mixdownName = HandBrakeEncoderHelpers.GetMixdown(track2.MixDown);
+                string mixdown = mixdownName != null ? ", " + mixdownName.DisplayName : string.Empty;
+                desc.AppendLine(string.Format("{0}{1}", EnumHelper<AudioEncoder>.GetDisplay(track2.Encoder), mixdown));
             }
 
             if (this.Task.AudioTracks.Count > 2)
@@ -521,13 +554,17 @@ namespace HandBrakeWPF.ViewModels
             if (this.Task.SubtitleTracks.Count >= 1)
             {
                 SubtitleTrack track1 = this.Task.SubtitleTracks[0];
-                desc.AppendLine(string.Format("{0}, {1}", track1.SourceTrack, track1.Burned ? ResourcesUI.SummaryView_Burned : string.Empty));
+                string subtitleName = track1.IsSrtSubtitle ? track1.SrtFileName : track1.SourceTrack.ToString();
+                string burned = track1.Burned ? ", " + ResourcesUI.SummaryView_Burned : string.Empty;
+                desc.AppendLine(string.Format("{0}{1}", subtitleName, burned));
             }
 
             if (this.Task.SubtitleTracks.Count >= 2)
             {
                 SubtitleTrack track2 = this.Task.SubtitleTracks[1];
-                desc.AppendLine(string.Format("{0}, {1}", track2.SourceTrack, track2.Burned ? ResourcesUI.SummaryView_Burned : string.Empty));
+                string subtitleName = track2.IsSrtSubtitle ? track2.SrtFileName : track2.SourceTrack.ToString();
+                string burned = track2.Burned ? ", " + ResourcesUI.SummaryView_Burned : string.Empty;
+                desc.AppendLine(string.Format("{0}{1}", subtitleName, burned));
             }
 
             if (this.Task.SubtitleTracks.Count > 2)
@@ -540,7 +577,7 @@ namespace HandBrakeWPF.ViewModels
 
         private void ClearDisplay()
         {
-            this.VideoTrackInfo = string.Empty;
+            this.VideoTrackInfo = ResourcesUI.SummaryView_NoTracks;
             this.NotifyOfPropertyChange(() => this.VideoTrackInfo);
 
             this.AudioTrackInfo = string.Empty;
@@ -552,10 +589,10 @@ namespace HandBrakeWPF.ViewModels
             this.ChapterInfo = string.Empty;
             this.NotifyOfPropertyChange(() => this.ChapterInfo);
 
-            this.FiltersInfo = string.Empty;
+            this.FiltersInfo = ResourcesUI.SummaryView_NoFilters;
             this.NotifyOfPropertyChange(() => this.FiltersInfo);
 
-            this.DimensionInfo = string.Empty;
+            this.DimensionInfo = ResourcesUI.SummaryView_NoSource;
             this.NotifyOfPropertyChange(() => this.ChapterInfo);
 
             this.AspectInfo = string.Empty;
@@ -595,9 +632,13 @@ namespace HandBrakeWPF.ViewModels
             {
                 this.PreviewNotAvailable = false;
                 this.PreviewImage = image;
+                this.MaxWidth = (int)image.Width;
+                this.MaxHeight = (int)image.Height;
                 this.IsPreviewInfoVisible = true;
                 this.NotifyOfPropertyChange(() => this.IsPreviewInfoVisible);
                 this.NotifyOfPropertyChange(() => this.PreviewImage);
+                this.NotifyOfPropertyChange(() => this.MaxWidth);
+                this.NotifyOfPropertyChange(() => this.MaxHeight);
             }
         }
 
index 47c93c62ed5b690047384d54c401745695d46d03..cadd5a5ee0d740c5230ea6fe7a5c21076d272b24 100644 (file)
                 <TabItem Name="summaryTab" Header="{x:Static Properties:ResourcesUI.MainView_SummaryTab}">\r
                     <ContentControl x:Name="SummaryViewModel" />\r
                 </TabItem>\r
-                <TabItem Name="videoTab" Header="{x:Static Properties:ResourcesUI.MainView_VideoTab}">\r
-                    <ContentControl x:Name="VideoViewModel" VerticalAlignment="Stretch" />\r
-                </TabItem>\r
                 <TabItem Name="pictureTab" Header="{x:Static Properties:ResourcesUI.MainView_PictureTab}">\r
                     <ContentControl x:Name="PictureSettingsViewModel" />\r
                 </TabItem>\r
                 <TabItem Name="filtersTab" Header="{x:Static Properties:ResourcesUI.MainView_FiltersTab}">\r
                     <ContentControl x:Name="FiltersViewModel" />\r
                 </TabItem>\r
+                <TabItem Name="videoTab" Header="{x:Static Properties:ResourcesUI.MainView_VideoTab}">\r
+                    <ContentControl x:Name="VideoViewModel" VerticalAlignment="Stretch" />\r
+                </TabItem>\r
                 <TabItem Name="audioTab" Header="{x:Static Properties:ResourcesUI.MainView_AudioTab}">\r
                     <ContentControl x:Name="AudioViewModel" />\r
                 </TabItem>\r
index 59a0ce04b7d1cb3d818ec803919825848af70ee0..fb3d978929faa46178b56496ac95f46b2499ac81 100644 (file)
         <converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
     </UserControl.Resources>
 
-    <Grid Margin="5,5,0,0">
+    <Grid Margin="10,5,0,5">
         <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="4*" />
-            <ColumnDefinition Width="5*" />
+            <ColumnDefinition Width="Auto" />
+            <ColumnDefinition Width="*" />
         </Grid.ColumnDefinitions>
 
-        <Grid.RowDefinitions>
-            <RowDefinition Height="*" />
-        </Grid.RowDefinitions>
-
         <!-- Column 1 -->
-
-        <Grid Margin="5,0,0,0" Grid.Column="0" >
+        <Grid Grid.Column="0" MinWidth="325" MaxWidth="400" >
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="75" />
                 <ColumnDefinition Width="*" />
@@ -59,8 +54,8 @@
 
 
             <TextBlock Text="Format:" FontSize="14" FontFamily="Sergio Light" Grid.Row="0" VerticalAlignment="Center" />
-            <ComboBox Name="Container" Width="100" HorizontalAlignment="Left" Margin="0,2,0,5"  Grid.Row="0" Grid.Column="1"
-                              ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Mux}"
+            <ComboBox Name="Container" Width="100" HorizontalAlignment="Left"  Grid.Row="0" Grid.Column="1"
+                              ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Mux}" VerticalAlignment="Center"
                               ItemsSource="{Binding OutputFormats, Converter={StaticResource enumComboConverter}}"
                               SelectedItem="{Binding SelectedOutputFormat, Converter={StaticResource enumComboConverter}}" />
             <CheckBox Name="WebOptimized" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1"
@@ -81,8 +76,8 @@
 
             <TextBlock Text="Tracks:" FontSize="14" FontFamily="Sergio Light" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" />
             <TextBlock Text="{Binding VideoTrackInfo}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" />
-            <TextBlock Text="{Binding AudioTrackInfo}" Grid.Row="6" Grid.Column="1" />
-            <TextBlock Text="{Binding SubtitleTrackInfo}" Grid.Row="7" Grid.Column="1" />
+            <TextBlock Text="{Binding AudioTrackInfo}" Grid.Row="6" Grid.Column="1" TextWrapping="Wrap" />
+            <TextBlock Text="{Binding SubtitleTrackInfo}" Grid.Row="7" Grid.Column="1" TextWrapping="Wrap" />
             <TextBlock Text="{Binding ChapterInfo}" Grid.Row="8" Grid.Column="1" />
 
             <TextBlock Text="Filters:" FontSize="14" FontFamily="Sergio Light" Grid.Row="10" Grid.Column="0" VerticalAlignment="Center" />
         </Grid>
 
         <!-- Column 2 -->
-
-        <Grid Grid.Column="1">
+        <Grid Grid.Column="1" Margin="10,0,0,5">
             <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="Auto" />
                 <ColumnDefinition Width="*" />
             </Grid.ColumnDefinitions>
             <Grid.RowDefinitions>
-                <RowDefinition Height="Auto" />
-                <RowDefinition Height="Auto" />
                 <RowDefinition Height="*" />
             </Grid.RowDefinitions>
-            
-            <Grid>
-                <Image Source="{Binding PreviewImage}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="10,5,10,0" x:Name="previewImage" MouseMove="PreviewImage_OnMouseMove" Panel.ZIndex="0" />
 
-                <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"  VerticalAlignment="Center" HorizontalAlignment="Left"  Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action PreviousPreview]"
+            <Grid Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Top">
+
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="*" />
+                    <RowDefinition Height="Auto" MinHeight="26" />
+                    <RowDefinition Height="Auto" MinHeight="26" />
+                </Grid.RowDefinitions>
+
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="Auto" />
+                    <ColumnDefinition Width="*" />
+                </Grid.ColumnDefinitions>
+
+                <Image Source="{Binding PreviewImage}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,5,10,0" x:Name="previewImage" MouseMove="PreviewImage_OnMouseMove" MouseLeave="PreviewImage_OnMouseLeave" Panel.ZIndex="0" Grid.ColumnSpan="2"
+                       MaxWidth="{Binding MaxWidth}" MaxHeight="{Binding MaxHeight}" />
+
+                <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"  VerticalAlignment="Center" HorizontalAlignment="Left"  Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action PreviousPreview]" Grid.ColumnSpan="2"
                         Background="Black" Opacity="0.75" Margin="20,0,0,0" Visibility="{Binding IsPreviousPreviewControlVisible, Converter={StaticResource boolToVisConverter}}" >
                     <TextBlock Text="&lt;" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
                 </Border>
 
-                <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"  VerticalAlignment="Center" HorizontalAlignment="Right" Panel.ZIndex="1"  cal:Message.Attach="[Event MouseDown] = [Action NextPreview]"
+                <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"  VerticalAlignment="Center" HorizontalAlignment="Right" Panel.ZIndex="1"  cal:Message.Attach="[Event MouseDown] = [Action NextPreview]" Grid.ColumnSpan="2"
                         Background="Black" Opacity="0.75" Margin="0,0,20,0" Visibility="{Binding IsNextPreviewControlVisible, Converter={StaticResource boolToVisConverter}}">
-                        <TextBlock Text="&gt;" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
+                    <TextBlock Text="&gt;" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
                 </Border>
 
-                <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"  VerticalAlignment="Bottom" HorizontalAlignment="Center" 
+                <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8"  VerticalAlignment="Bottom" HorizontalAlignment="Center"  Grid.ColumnSpan="2"
                         Background="Black" Opacity="0.75" Margin="0,5,0,10">
                     <TextBlock Text="{Binding PreviewInfo}" FontSize="14" Foreground="White" Padding="8,3" Visibility="{Binding IsPreviewInfoVisible, Converter={StaticResource boolToVisConverter}}" />
                 </Border>
-            </Grid>
-          
-
-            <Grid Margin="10,5,0,0" Grid.Row="1">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="85" />
-                    <ColumnDefinition Width="*" />
-                </Grid.ColumnDefinitions>
-
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="Auto" />
-                    <RowDefinition Height="Auto" />
-                    <RowDefinition Height="Auto" />
-                </Grid.RowDefinitions>
 
-                <Grid.Resources>
-                    <Style TargetType="TextBlock">
-                        <Setter Property="Margin" Value="0,0,0,0" />
-                        <Setter Property="Padding" Value="3" />
-                    </Style>
-                </Grid.Resources>
+                <TextBlock Text="Dimensions:" FontSize="14" FontFamily="Sergio Light" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" />
+                <TextBlock Text="{Binding DimensionInfo}" HorizontalAlignment="Left" VerticalAlignment="Center"  Grid.Row="1" Grid.Column="1" Margin="5,0,0,0" />
 
-                <TextBlock Text="Dimensions:" FontSize="14" FontFamily="Sergio Light" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" />
-                <TextBlock Text="{Binding DimensionInfo}" HorizontalAlignment="Left" VerticalAlignment="Center"  Grid.Row="0" Grid.Column="1" />
+                <TextBlock Text="Aspect:" FontSize="14" FontFamily="Sergio Light" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Visibility="Collapsed" />
+                <TextBlock Text="{Binding AspectInfo}" HorizontalAlignment="Left" VerticalAlignment="Center"  Grid.Row="2" Grid.Column="1" Margin="5,0,0,0" Visibility="Collapsed" />
 
-                <TextBlock Text="Aspect:" FontSize="14" FontFamily="Sergio Light" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Visibility="Collapsed" />
-                <TextBlock Text="{Binding AspectInfo}" HorizontalAlignment="Left" VerticalAlignment="Center"  Grid.Row="1" Grid.Column="1" Visibility="Collapsed" />
             </Grid>
         </Grid>
 
index 744003698ba8f2b637b1ba36e0f336e94e7a42a0..5b0354576507ced8af92c5de336a03ba75fd918f 100644 (file)
@@ -11,6 +11,7 @@ namespace HandBrakeWPF.Views
 {
     using System.Windows.Controls;
     using System.Windows.Input;
+    using System.Windows.Media;
 
     using HandBrakeWPF.ViewModels.Interfaces;
 
@@ -42,5 +43,18 @@ namespace HandBrakeWPF.Views
                 ((ISummaryViewModel)this.DataContext).SetPreviewControlVisibility(leftHalf, rightHalf);
             }
         }
+
+        private void PreviewImage_OnMouseLeave(object sender, MouseEventArgs e)
+        {
+            HitTestResult result = VisualTreeHelper.HitTest(this.previewImage, e.GetPosition(this.previewImage));
+
+            if (result != null && result.VisualHit.GetType() == typeof(Image))
+            {
+                e.Handled = true;
+                return;
+            }
+
+            ((ISummaryViewModel)this.DataContext).SetPreviewControlVisibility(false, false);
+        }
     }
 }