]> granicus.if.org Git - handbrake/commitdiff
WinGui: Just some prototype code for safe keeping. Some ideas around an Instant HandB...
authorsr55 <sr55.hb@outlook.com>
Sat, 29 Jun 2013 15:36:48 +0000 (15:36 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 29 Jun 2013 15:36:48 +0000 (15:36 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5617 b64f7644-9d1e-0410-96f1-a4d463321fa5

13 files changed:
win/CS/HandBrake10.sln.DotSettings
win/CS/HandBrakeWPF/App.xaml.cs
win/CS/HandBrakeWPF/AppArguments.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Model/ShellWindow.cs
win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs
win/CS/HandBrakeWPF/Views/InstantMainView.xaml [new file with mode: 0644]
win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs [new file with mode: 0644]
win/CS/HandBrakeWPF/Views/MainView.xaml
win/CS/HandBrakeWPF/Views/ShellView.xaml
win/CS/HandBrakeWPF/Views/ShellView.xaml.cs

index 66ba7643ddcf4e02bd229baa812cc32d8bfc923f..d55f220ff26418aa6a931acc75d4168654f77607 100644 (file)
        <s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=JavaScript/@EntryIndexedValue">NotOverridden</s:String>
        <s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=MsBuild/@EntryIndexedValue">NotOverridden</s:String>
        <s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=VB/@EntryIndexedValue">NotOverridden</s:String>
-       <s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=Xaml/@EntryIndexedValue">NotOverridden</s:String></wpf:ResourceDictionary>
\ No newline at end of file
+       <s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=Xaml/@EntryIndexedValue">NotOverridden</s:String>
+       <s:Int64 x:Key="/Default/StyleCopOptions/ParsingPerformance/@EntryValue">8</s:Int64></wpf:ResourceDictionary>
\ No newline at end of file
index b674aa7b678b17a187e2b6e98ef60bb29b826d02..1d443467706a9707c41469954daa1fd7408c3521 100644 (file)
@@ -44,14 +44,20 @@ namespace HandBrakeWPF
         /// </param>\r
         protected override void OnStartup(StartupEventArgs e)\r
         {\r
+            if (e.Args.Any(f => f.Equals("--instant")))\r
+            {\r
+                AppArguments.IsInstantHandBrake = true;\r
+                MessageBox.Show("Instant HandBrake is just a prototype for toying with ideas. It may or may not work, or even be included in future builds.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);\r
+            }\r
+\r
             base.OnStartup(e);\r
 \r
             // If we have a file dropped on the icon, try scanning it.\r
-            string[] fileNames = e.Args;\r
-            if (fileNames.Any() && (File.Exists(fileNames[0]) || Directory.Exists(fileNames[0])))\r
+            string[] args = e.Args;\r
+            if (args.Any() && (File.Exists(args[0]) || Directory.Exists(args[0])))\r
             {\r
                 IMainViewModel mvm = IoC.Get<IMainViewModel>();\r
-                mvm.StartScan(fileNames[0], 0);\r
+                mvm.StartScan(args[0], 0);\r
             }\r
         }\r
 \r
diff --git a/win/CS/HandBrakeWPF/AppArguments.cs b/win/CS/HandBrakeWPF/AppArguments.cs
new file mode 100644 (file)
index 0000000..970ba99
--- /dev/null
@@ -0,0 +1,22 @@
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="AppArguments.cs" company="HandBrake Project (http://handbrake.fr)">\r
+//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+//   Defines the AppArguments type.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF\r
+{\r
+    /// <summary>\r
+    /// The app arguments.\r
+    /// </summary>\r
+    public class AppArguments\r
+    {\r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether is instant hand brake.\r
+        /// </summary>\r
+        public static bool IsInstantHandBrake { get; set; }\r
+    }\r
+}\r
index 83535814b9269071c8865c6d034b4d161592e48d..ce90d914a182cfb8571be3b83d38e8790991bde8 100644 (file)
       <Generator>MSBuild:Compile</Generator>\r
       <SubType>Designer</SubType>\r
     </ApplicationDefinition>\r
+    <Compile Include="AppArguments.cs" />\r
     <Compile Include="AttachedProperties\DriveMenu.cs" />\r
     <Compile Include="AttachedProperties\MenuItemExtensions.cs" />\r
     <Compile Include="Commands\CancelScanCommand.cs" />\r
     <Compile Include="Views\EncoderOptionsView.xaml.cs">\r
       <DependentUpon>EncoderOptionsView.xaml</DependentUpon>\r
     </Compile>\r
+    <Compile Include="Views\InstantMainView.xaml.cs">\r
+      <DependentUpon>InstantMainView.xaml</DependentUpon>\r
+    </Compile>\r
     <Compile Include="Views\QueueSelectionView.xaml.cs">\r
       <DependentUpon>QueueSelectionView.xaml</DependentUpon>\r
     </Compile>\r
       <Generator>MSBuild:Compile</Generator>\r
       <SubType>Designer</SubType>\r
     </Page>\r
+    <Page Include="Views\InstantMainView.xaml">\r
+      <SubType>Designer</SubType>\r
+      <Generator>MSBuild:Compile</Generator>\r
+    </Page>\r
     <Page Include="Views\QueueSelectionView.xaml">\r
       <Generator>MSBuild:Compile</Generator>\r
       <SubType>Designer</SubType>\r
index 05ca1995e7e52e8aa57edb33cbae60f06a06045e..bbb71625eed4148880abdcb302f187e2ea864940 100644 (file)
@@ -15,6 +15,7 @@ namespace HandBrakeWPF.Model
     public enum ShellWindow\r
     {\r
         MainWindow,\r
-        OptionsWindow\r
+        OptionsWindow,\r
+        InstantMainWindow\r
     }\r
 }\r
index 67dcf4c0930aceba30468c4a26ca097b13c2079e..6ccc50777b910e5f8c428d712722621a3bb82ec0 100644 (file)
@@ -21,6 +21,11 @@ namespace HandBrakeWPF.ViewModels.Interfaces
         /// </summary>\r
         Preset SelectedPreset { set; }\r
 \r
+        /// <summary>\r
+        /// Gets or Sets IsInstandHandBrake.\r
+        /// </summary>\r
+        bool IsInstandHandBrake { get; set; }\r
+\r
         /// <summary>\r
         /// Shutdown the Application\r
         /// </summary>\r
index 81ac6a688dd2f78a231b730e843f72d647b0bca2..1e3754de7d9f6dc9371e93bae2df8d5ad56fa0b9 100644 (file)
@@ -922,8 +922,16 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets or sets a value indicating progress percentage.\r
+        /// </summary>\r
         public int ProgressPercentage { get; set; }\r
 \r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether the app is in "instant" mode\r
+        /// </summary>\r
+        public bool IsInstandHandBrake { get; set; }\r
+\r
         #endregion\r
 \r
         #region Load and Shutdown Handling\r
@@ -950,12 +958,18 @@ namespace HandBrakeWPF.ViewModels
                                     "Preset Update", MessageBoxButton.OK, MessageBoxImage.Information);\r
 \r
             // Queue Recovery\r
-            QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);\r
+            if (!AppArguments.IsInstantHandBrake)\r
+            {\r
+                QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);\r
+            }\r
 \r
             this.SelectedPreset = this.presetService.DefaultPreset;\r
 \r
             // Populate the Source menu with drives.\r
-            this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());\r
+            if (!AppArguments.IsInstantHandBrake)\r
+            {\r
+                this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());\r
+            }\r
 \r
             // Log Cleaning\r
             if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs))\r
@@ -1897,9 +1911,15 @@ namespace HandBrakeWPF.ViewModels
                 {\r
                     if (this.queueProcessor.EncodeService.IsEncoding)\r
                     {\r
+                        string josPending = string.Empty;\r
+                        if (this.IsInstandHandBrake)\r
+                        {\r
+                            josPending = ",  Pending Jobs {5}";\r
+                        }\r
+\r
                         this.ProgramStatusLabel =\r
                             string.Format(\r
-                                "{0:00.00}%,  FPS: {1:000.0},  Avg FPS: {2:000.0},  Time Remaining: {3},  Elapsed: {4:hh\\:mm\\:ss},  Pending Jobs {5}",\r
+                                "{0:00.00}%,  FPS: {1:000.0},  Avg FPS: {2:000.0},  Time Remaining: {3},  Elapsed: {4:hh\\:mm\\:ss}" + josPending,\r
                                 e.PercentComplete,\r
                                 e.CurrentFrameRate,\r
                                 e.AverageFrameRate,\r
index 39fee77fd1858b62cc61f1f86905fde97672b236..4a4aebf43c689c58cf9339497cee9ef76adbedb7 100644 (file)
@@ -13,6 +13,8 @@ namespace HandBrakeWPF.ViewModels
 \r
     using Caliburn.Micro;\r
 \r
+    using Castle.Facilities.FactorySupport;\r
+\r
     using HandBrake.ApplicationServices.Services.Interfaces;\r
 \r
     using HandBrakeWPF.Helpers;\r
@@ -42,6 +44,11 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private bool showOptions;\r
 \r
+        /// <summary>\r
+        /// The show instant.\r
+        /// </summary>\r
+        private bool showInstant;\r
+\r
         #endregion\r
 \r
         /// <summary>\r
@@ -53,8 +60,19 @@ namespace HandBrakeWPF.ViewModels
         public ShellViewModel(IErrorService errorService)\r
         {\r
             this.errorService = errorService;\r
-            this.showMainWindow = true;\r
-            this.showOptions = false;\r
+\r
+            if (!AppArguments.IsInstantHandBrake)\r
+            {\r
+                this.showMainWindow = true;\r
+                this.showOptions = false;\r
+                this.showInstant = false;\r
+            }\r
+            else\r
+            {\r
+                this.showMainWindow = false;\r
+                this.showOptions = false;\r
+                this.showInstant = true;\r
+            }\r
         }\r
 \r
         /// <summary>\r
@@ -69,16 +87,29 @@ namespace HandBrakeWPF.ViewModels
             {\r
                 this.ShowMainWindow = true;\r
                 this.ShowOptions = false;\r
+                this.ShowInstant = false;\r
+                this.MainViewModel.IsInstandHandBrake = false;\r
             }\r
             else if (window == ShellWindow.OptionsWindow)\r
             {\r
                 this.ShowOptions = true;\r
                 this.ShowMainWindow = false;\r
+                this.ShowInstant = false;\r
+                this.MainViewModel.IsInstandHandBrake = false;\r
+            }\r
+            else if (window == ShellWindow.InstantMainWindow)\r
+            {\r
+                this.ShowInstant = true;\r
+                this.ShowOptions = false;\r
+                this.ShowMainWindow = false;\r
+                this.MainViewModel.IsInstandHandBrake = true;\r
             }\r
             else\r
             {\r
                 this.ShowMainWindow = true;\r
                 this.ShowOptions = false;\r
+                this.ShowInstant = false;\r
+                this.MainViewModel.IsInstandHandBrake = false;\r
             }\r
         }\r
 \r
@@ -126,6 +157,22 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether ShowInstant.\r
+        /// </summary>\r
+        public bool ShowInstant\r
+        {\r
+            get\r
+            {\r
+                return this.showInstant;\r
+            }\r
+            set\r
+            {\r
+                this.showInstant = value;\r
+                this.NotifyOfPropertyChange(() => this.ShowInstant);\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// Gets WindowTitle.\r
         /// </summary>\r
@@ -133,7 +180,7 @@ namespace HandBrakeWPF.ViewModels
         {\r
             get\r
             {\r
-                return "HandBrake";\r
+                return AppArguments.IsInstantHandBrake ? "Instant HandBrake" : "HandBrake";\r
             }\r
         }\r
 \r
diff --git a/win/CS/HandBrakeWPF/Views/InstantMainView.xaml b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml
new file mode 100644 (file)
index 0000000..29d8f1b
--- /dev/null
@@ -0,0 +1,182 @@
+<UserControl x:Class="HandBrakeWPF.Views.InstantMainView"\r
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" \r
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"\r
+             xmlns:cal="http://www.caliburnproject.org"\r
+             xmlns:controls="clr-namespace:HandBrakeWPF.Controls"\r
+             xmlns:converters="clr-namespace:HandBrakeWPF.Converters"\r
+             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"\r
+             mc:Ignorable="d" \r
+             cal:Message.Attach="[Event Loaded] = [Action Load]"\r
+             >\r
+\r
+    <i:Interaction.Triggers>\r
+        <i:EventTrigger EventName="Drop">\r
+            <cal:ActionMessage MethodName="FilesDroppedOnWindow">\r
+                <cal:Parameter Value="$eventArgs" />\r
+            </cal:ActionMessage>\r
+        </i:EventTrigger>\r
+    </i:Interaction.Triggers>\r
+\r
+    <UserControl.Resources>\r
+        <converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />\r
+    </UserControl.Resources>\r
+\r
+    <!-- Window Body -->\r
+    <Grid>\r
+        <Grid.RowDefinitions>\r
+            <RowDefinition Height="Auto" />\r
+            <RowDefinition Height="Auto" />\r
+            <RowDefinition Height="Auto" />\r
+            <RowDefinition Height="*" />\r
+            <RowDefinition Height="Auto" />\r
+        </Grid.RowDefinitions>\r
+\r
+\r
+        <!-- Source -->\r
+        <StackPanel Orientation="Vertical" Grid.Row="0">\r
+            <!--  Source  -->\r
+            <StackPanel Margin="10,5,5,5"\r
+                            HorizontalAlignment="Stretch"\r
+                            VerticalAlignment="Stretch"\r
+                            >\r
+                <StackPanel Orientation="Horizontal">\r
+                    <Label Content="Source" FontWeight="Bold" />\r
+                    <Label Content="{Binding Path=SourceLabel}" />\r
+                </StackPanel>\r
+\r
+                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8,10,0,10">\r
+\r
+                    <TextBlock Text="Drag and Drop a file  - OR - Open a " />\r
+                    <Button cal:Message.Attach="[Event Click] = [Action FileScan]" Padding="8,2">\r
+                        File\r
+                    </Button>\r
+                    <TextBlock Text="- OR -" FontWeight="Bold" Margin="10,0,10,0" />\r
+                    <Button cal:Message.Attach="[Event Click] = [Action FolderScan]" Padding="8,2">\r
+                        Folder\r
+                    </Button>\r
+\r
+                </StackPanel>\r
+\r
+\r
+                <StackPanel Orientation="Horizontal">\r
+                    <Label Margin="8,0,0,0" Content="Title" />\r
+                    <ComboBox Name="Titles"\r
+                                  MinWidth="100"\r
+                                  Margin="8,0,0,0"\r
+                                  ItemsSource="{Binding ScannedSource.Titles}"\r
+                                  SelectedItem="{Binding Path=SelectedTitle}"\r
+                              />\r
+                    <!--<Label Margin="8,0,0,0" Content="Angle" />\r
+                    <ComboBox Name="Angles"\r
+                                  MinWidth="60"\r
+                                  Margin="8,0,0,0"\r
+                                  ItemsSource="{Binding Angles}"\r
+                                  SelectedItem="{Binding SelectedAngle}"/>-->\r
+\r
+                    <Label Margin="8,0,0,0" Content="Chapters" />\r
+                    <ComboBox Name="StartPoint"\r
+                                  MinWidth="60"\r
+                                  Margin="8,0,0,0"\r
+                                  ItemsSource="{Binding StartEndRangeItems}"\r
+                                  SelectedItem="{Binding SelectedStartPoint}"/>\r
+\r
+                    <Label Margin="8,0,0,0" Content="through" />\r
+                    <ComboBox Name="EndPoint"\r
+                                  MinWidth="60"\r
+                                  Margin="8,0,0,0"\r
+                                  ItemsSource="{Binding StartEndRangeItems}"\r
+                                  SelectedItem="{Binding SelectedEndPoint}"/>\r
+\r
+                    <Label Margin="8,0,0,0" Content="Duration" />\r
+                    <Label Margin="8,0,0,0" Content="{Binding Duration}" />\r
+                </StackPanel>\r
+            </StackPanel>\r
+        </StackPanel>\r
+\r
+\r
+        <!-- Destination -->\r
+        <StackPanel Grid.Row="1"\r
+                        Margin="10,5,5,5"\r
+                        HorizontalAlignment="Stretch"\r
+                        VerticalAlignment="Stretch"\r
+                        >\r
+            <Label Content="Destination" FontWeight="Bold" />\r
+            <Grid>\r
+                <Grid.ColumnDefinitions>\r
+                    <ColumnDefinition Width="Auto" />\r
+                    <ColumnDefinition Width="*" />\r
+                    <ColumnDefinition Width="Auto" />\r
+                </Grid.ColumnDefinitions>\r
+                <Label Margin="8,0,0,0" Content="File" />\r
+                <TextBox Name="Destination"\r
+                             Grid.Column="1"\r
+                             Margin="8,0,0,0"\r
+                             Text="{Binding Destination,\r
+                                            UpdateSourceTrigger=PropertyChanged}"\r
+                             />\r
+                <Button Name="DestinationBrowser"\r
+                            Grid.Column="2"\r
+                            Margin="8,0,5,0"\r
+                        Padding="8,2"\r
+                            Content="Browse"\r
+                            cal:Message.Attach="[Event Click] = [Action BrowseDestination]"\r
+                            />\r
+            </Grid>\r
+        </StackPanel>\r
+\r
+        <!-- Opitons -->\r
+        <StackPanel Grid.Row="2"\r
+                        Margin="10,5,5,5"\r
+                        HorizontalAlignment="Stretch"\r
+                        VerticalAlignment="Stretch"\r
+                        >\r
+            <Label Content="Options" FontWeight="Bold" />\r
+\r
+            <StackPanel Orientation="Horizontal" Margin="8,0,0,0">\r
+                <TextBlock Text="Preset:" Margin="0,0,5,0" />\r
+                <ComboBox ItemsSource="{Binding Presets}" SelectedItem="{Binding SelectedPreset}" MinWidth="150" />\r
+            </StackPanel>\r
+\r
+        </StackPanel>\r
+\r
+\r
+        <!-- Buttons and Queueing -->\r
+        <Grid Grid.Row="3" Margin="10,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >\r
+            <Grid.RowDefinitions>\r
+                <RowDefinition Height="Auto" />\r
+                <RowDefinition Height="Auto" />\r
+            </Grid.RowDefinitions>\r
+            <Label Content="Start" FontWeight="Bold" Grid.Row="0" />\r
+            <Button Content="Start Encoding" cal:Message.Attach="[Event Click] = [Action StartEncode]"  FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"\r
+                    Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />\r
+            <Button Content="Stop Encoding" cal:Message.Attach="[Event Click] = [Action StopEncode]"  FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center" \r
+                    Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
+        </Grid>\r
+\r
+\r
+        <!--  StatusPanel  -->\r
+        <controls:StatusPanel x:Name="loadingPanel"\r
+                              Grid.Row="3"\r
+                              Grid.RowSpan="2"\r
+                              Height="70"\r
+                              VerticalAlignment="Bottom"\r
+                              Panel.ZIndex="10"\r
+                              IsLoading="{Binding ShowStatusWindow}"\r
+                              Message="{Binding StatusLabel}"\r
+                              SubMessage="Please Wait ..."\r
+                              />\r
+\r
+        <!--  Status Bar  -->\r
+        <StatusBar Grid.Row="4" Grid.ColumnSpan="2" MinHeight="32" >\r
+\r
+            <ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"\r
+                         Width="100" Height="18" VerticalAlignment="Center"/>\r
+            <Label VerticalAlignment="Center"\r
+                   Content="{Binding Path=ProgramStatusLabel}" />\r
+\r
+        </StatusBar>\r
+\r
+    </Grid>\r
+</UserControl>\r
diff --git a/win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs
new file mode 100644 (file)
index 0000000..4a74deb
--- /dev/null
@@ -0,0 +1,15 @@
+namespace HandBrakeWPF.Views\r
+{\r
+    using System.Windows.Controls;\r
+\r
+    /// <summary>\r
+    /// Interaction logic for InstantMainView.xaml\r
+    /// </summary>\r
+    public partial class InstantMainView : UserControl\r
+    {\r
+        public InstantMainView()\r
+        {\r
+            InitializeComponent();\r
+        }\r
+    }\r
+}\r
index 67ac70c21cfc82679e20584cbb21a5d8a8b0f90e..38545de00d4562028beedaf945f0e947a837721e 100644 (file)
                         Margin="10,10,5,5"\r
                         HorizontalAlignment="Stretch"\r
                         VerticalAlignment="Stretch"\r
+                        MinHeight="350" MinWidth="720"\r
                         >\r
                 <TabItem Name="pictureTab" Header="Picture">\r
                     <ContentControl x:Name="PictureSettingsViewModel" />\r
index ae8d26747b7c12088329a13de13cc415c8dfe304..43edcb36bd9c13dfb2b453c20b88011ec0247dde 100644 (file)
@@ -3,6 +3,7 @@
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
         xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"\r
         xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"\r
+        xmlns:views="clr-namespace:HandBrakeWPF.Views"\r
         Title="{Data:Binding Path=WindowTitle}"\r
         Width="1015"\r
         Height="670"\r
@@ -14,6 +15,7 @@
         WindowStartupLocation="CenterScreen"\r
         TextOptions.TextFormattingMode="Display"\r
         Style="{StaticResource mainWindowStyle}"\r
+        x:Name="shellView"\r
         >\r
     <Window.Resources>\r
         <Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />\r
@@ -22,5 +24,8 @@
     <Grid>\r
         <ContentControl x:Name="MainViewModel"  Visibility="{Binding ShowMainWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
         <ContentControl x:Name="OptionsViewModel"  Visibility="{Binding ShowOptions, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
+\r
+        <views:InstantMainView DataContext="{Binding MainViewModel}" \r
+                               Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ShowInstant, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
     </Grid>\r
 </Window>\r
index b1eff7ddd515f1d1bfe6db41bfbe996acc608d9d..067446f12ded4d81b6c7d8a5322ee0897d04d4f6 100644 (file)
@@ -82,6 +82,14 @@ namespace HandBrakeWPF.Views
             {\r
                 this.TaskbarItemInfo = Win7.WindowsTaskbar;\r
             }\r
+\r
+            // Window Sizing\r
+            if (AppArguments.IsInstantHandBrake)\r
+            {\r
+                this.SizeToContent = SizeToContent.WidthAndHeight;\r
+                this.MinHeight = 380;\r
+                this.MinWidth = 600;\r
+            }\r
         }\r
 \r
         /// <summary>\r