diff options
author | sr55 <[email protected]> | 2013-06-29 15:36:48 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-06-29 15:36:48 +0000 |
commit | 75e97b7e676869c9ea83200b2f882ba4e0435f23 (patch) | |
tree | d164b9e581cf1bb85b4d15a8b68eb6f3dcb49ab3 | |
parent | acd0b75397ae0dfc18d1fd31c4031e87c22a6134 (diff) |
WinGui: Just some prototype code for safe keeping. Some ideas around an Instant HandBrake window.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5617 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/CS/HandBrake10.sln.DotSettings | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/App.xaml.cs | 12 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/AppArguments.cs | 22 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 8 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Model/ShellWindow.cs | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs | 5 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 26 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs | 53 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/InstantMainView.xaml | 182 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs | 15 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 1 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml | 5 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml.cs | 8 |
13 files changed, 332 insertions, 11 deletions
diff --git a/win/CS/HandBrake10.sln.DotSettings b/win/CS/HandBrake10.sln.DotSettings index 66ba7643d..d55f220ff 100644 --- a/win/CS/HandBrake10.sln.DotSettings +++ b/win/CS/HandBrake10.sln.DotSettings @@ -1013,4 +1013,5 @@ <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 diff --git a/win/CS/HandBrakeWPF/App.xaml.cs b/win/CS/HandBrakeWPF/App.xaml.cs index b674aa7b6..1d4434677 100644 --- a/win/CS/HandBrakeWPF/App.xaml.cs +++ b/win/CS/HandBrakeWPF/App.xaml.cs @@ -44,14 +44,20 @@ namespace HandBrakeWPF /// </param>
protected override void OnStartup(StartupEventArgs e)
{
+ if (e.Args.Any(f => f.Equals("--instant")))
+ {
+ AppArguments.IsInstantHandBrake = true;
+ 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);
+ }
+
base.OnStartup(e);
// If we have a file dropped on the icon, try scanning it.
- string[] fileNames = e.Args;
- if (fileNames.Any() && (File.Exists(fileNames[0]) || Directory.Exists(fileNames[0])))
+ string[] args = e.Args;
+ if (args.Any() && (File.Exists(args[0]) || Directory.Exists(args[0])))
{
IMainViewModel mvm = IoC.Get<IMainViewModel>();
- mvm.StartScan(fileNames[0], 0);
+ mvm.StartScan(args[0], 0);
}
}
diff --git a/win/CS/HandBrakeWPF/AppArguments.cs b/win/CS/HandBrakeWPF/AppArguments.cs new file mode 100644 index 000000000..970ba9957 --- /dev/null +++ b/win/CS/HandBrakeWPF/AppArguments.cs @@ -0,0 +1,22 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AppArguments.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the AppArguments type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF
+{
+ /// <summary>
+ /// The app arguments.
+ /// </summary>
+ public class AppArguments
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether is instant hand brake.
+ /// </summary>
+ public static bool IsInstantHandBrake { get; set; }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 83535814b..ce90d914a 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -123,6 +123,7 @@ <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
+ <Compile Include="AppArguments.cs" />
<Compile Include="AttachedProperties\DriveMenu.cs" />
<Compile Include="AttachedProperties\MenuItemExtensions.cs" />
<Compile Include="Commands\CancelScanCommand.cs" />
@@ -184,6 +185,9 @@ <Compile Include="Views\EncoderOptionsView.xaml.cs">
<DependentUpon>EncoderOptionsView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\InstantMainView.xaml.cs">
+ <DependentUpon>InstantMainView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\QueueSelectionView.xaml.cs">
<DependentUpon>QueueSelectionView.xaml</DependentUpon>
</Compile>
@@ -353,6 +357,10 @@ <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\InstantMainView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Views\QueueSelectionView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
diff --git a/win/CS/HandBrakeWPF/Model/ShellWindow.cs b/win/CS/HandBrakeWPF/Model/ShellWindow.cs index 05ca1995e..bbb71625e 100644 --- a/win/CS/HandBrakeWPF/Model/ShellWindow.cs +++ b/win/CS/HandBrakeWPF/Model/ShellWindow.cs @@ -15,6 +15,7 @@ namespace HandBrakeWPF.Model public enum ShellWindow
{
MainWindow,
- OptionsWindow
+ OptionsWindow,
+ InstantMainWindow
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs index 67dcf4c09..6ccc50777 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs @@ -22,6 +22,11 @@ namespace HandBrakeWPF.ViewModels.Interfaces Preset SelectedPreset { set; }
/// <summary>
+ /// Gets or Sets IsInstandHandBrake.
+ /// </summary>
+ bool IsInstandHandBrake { get; set; }
+
+ /// <summary>
/// Shutdown the Application
/// </summary>
void ExitApplication();
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 81ac6a688..1e3754de7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -922,8 +922,16 @@ namespace HandBrakeWPF.ViewModels }
}
+ /// <summary>
+ /// Gets or sets a value indicating progress percentage.
+ /// </summary>
public int ProgressPercentage { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the app is in "instant" mode
+ /// </summary>
+ public bool IsInstandHandBrake { get; set; }
+
#endregion
#region Load and Shutdown Handling
@@ -950,12 +958,18 @@ namespace HandBrakeWPF.ViewModels "Preset Update", MessageBoxButton.OK, MessageBoxImage.Information);
// Queue Recovery
- QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);
+ if (!AppArguments.IsInstantHandBrake)
+ {
+ QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);
+ }
this.SelectedPreset = this.presetService.DefaultPreset;
// Populate the Source menu with drives.
- this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());
+ if (!AppArguments.IsInstantHandBrake)
+ {
+ this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());
+ }
// Log Cleaning
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs))
@@ -1897,9 +1911,15 @@ namespace HandBrakeWPF.ViewModels {
if (this.queueProcessor.EncodeService.IsEncoding)
{
+ string josPending = string.Empty;
+ if (this.IsInstandHandBrake)
+ {
+ josPending = ", Pending Jobs {5}";
+ }
+
this.ProgramStatusLabel =
string.Format(
- "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}, Pending Jobs {5}",
+ "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}" + josPending,
e.PercentComplete,
e.CurrentFrameRate,
e.AverageFrameRate,
diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs index 39fee77fd..4a4aebf43 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs @@ -13,6 +13,8 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro;
+ using Castle.Facilities.FactorySupport;
+
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrakeWPF.Helpers;
@@ -42,6 +44,11 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private bool showOptions;
+ /// <summary>
+ /// The show instant.
+ /// </summary>
+ private bool showInstant;
+
#endregion
/// <summary>
@@ -53,8 +60,19 @@ namespace HandBrakeWPF.ViewModels public ShellViewModel(IErrorService errorService)
{
this.errorService = errorService;
- this.showMainWindow = true;
- this.showOptions = false;
+
+ if (!AppArguments.IsInstantHandBrake)
+ {
+ this.showMainWindow = true;
+ this.showOptions = false;
+ this.showInstant = false;
+ }
+ else
+ {
+ this.showMainWindow = false;
+ this.showOptions = false;
+ this.showInstant = true;
+ }
}
/// <summary>
@@ -69,16 +87,29 @@ namespace HandBrakeWPF.ViewModels {
this.ShowMainWindow = true;
this.ShowOptions = false;
+ this.ShowInstant = false;
+ this.MainViewModel.IsInstandHandBrake = false;
}
else if (window == ShellWindow.OptionsWindow)
{
this.ShowOptions = true;
this.ShowMainWindow = false;
+ this.ShowInstant = false;
+ this.MainViewModel.IsInstandHandBrake = false;
+ }
+ else if (window == ShellWindow.InstantMainWindow)
+ {
+ this.ShowInstant = true;
+ this.ShowOptions = false;
+ this.ShowMainWindow = false;
+ this.MainViewModel.IsInstandHandBrake = true;
}
else
{
this.ShowMainWindow = true;
this.ShowOptions = false;
+ this.ShowInstant = false;
+ this.MainViewModel.IsInstandHandBrake = false;
}
}
@@ -127,13 +158,29 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
+ /// Gets or sets a value indicating whether ShowInstant.
+ /// </summary>
+ public bool ShowInstant
+ {
+ get
+ {
+ return this.showInstant;
+ }
+ set
+ {
+ this.showInstant = value;
+ this.NotifyOfPropertyChange(() => this.ShowInstant);
+ }
+ }
+
+ /// <summary>
/// Gets WindowTitle.
/// </summary>
public string WindowTitle
{
get
{
- return "HandBrake";
+ return AppArguments.IsInstantHandBrake ? "Instant HandBrake" : "HandBrake";
}
}
diff --git a/win/CS/HandBrakeWPF/Views/InstantMainView.xaml b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml new file mode 100644 index 000000000..29d8f1b4e --- /dev/null +++ b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml @@ -0,0 +1,182 @@ +<UserControl x:Class="HandBrakeWPF.Views.InstantMainView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
+ xmlns:converters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+ mc:Ignorable="d"
+ cal:Message.Attach="[Event Loaded] = [Action Load]"
+ >
+
+ <i:Interaction.Triggers>
+ <i:EventTrigger EventName="Drop">
+ <cal:ActionMessage MethodName="FilesDroppedOnWindow">
+ <cal:Parameter Value="$eventArgs" />
+ </cal:ActionMessage>
+ </i:EventTrigger>
+ </i:Interaction.Triggers>
+
+ <UserControl.Resources>
+ <converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ </UserControl.Resources>
+
+ <!-- Window Body -->
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+
+ <!-- Source -->
+ <StackPanel Orientation="Vertical" Grid.Row="0">
+ <!-- Source -->
+ <StackPanel Margin="10,5,5,5"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ >
+ <StackPanel Orientation="Horizontal">
+ <Label Content="Source" FontWeight="Bold" />
+ <Label Content="{Binding Path=SourceLabel}" />
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8,10,0,10">
+
+ <TextBlock Text="Drag and Drop a file - OR - Open a " />
+ <Button cal:Message.Attach="[Event Click] = [Action FileScan]" Padding="8,2">
+ File
+ </Button>
+ <TextBlock Text="- OR -" FontWeight="Bold" Margin="10,0,10,0" />
+ <Button cal:Message.Attach="[Event Click] = [Action FolderScan]" Padding="8,2">
+ Folder
+ </Button>
+
+ </StackPanel>
+
+
+ <StackPanel Orientation="Horizontal">
+ <Label Margin="8,0,0,0" Content="Title" />
+ <ComboBox Name="Titles"
+ MinWidth="100"
+ Margin="8,0,0,0"
+ ItemsSource="{Binding ScannedSource.Titles}"
+ SelectedItem="{Binding Path=SelectedTitle}"
+ />
+ <!--<Label Margin="8,0,0,0" Content="Angle" />
+ <ComboBox Name="Angles"
+ MinWidth="60"
+ Margin="8,0,0,0"
+ ItemsSource="{Binding Angles}"
+ SelectedItem="{Binding SelectedAngle}"/>-->
+
+ <Label Margin="8,0,0,0" Content="Chapters" />
+ <ComboBox Name="StartPoint"
+ MinWidth="60"
+ Margin="8,0,0,0"
+ ItemsSource="{Binding StartEndRangeItems}"
+ SelectedItem="{Binding SelectedStartPoint}"/>
+
+ <Label Margin="8,0,0,0" Content="through" />
+ <ComboBox Name="EndPoint"
+ MinWidth="60"
+ Margin="8,0,0,0"
+ ItemsSource="{Binding StartEndRangeItems}"
+ SelectedItem="{Binding SelectedEndPoint}"/>
+
+ <Label Margin="8,0,0,0" Content="Duration" />
+ <Label Margin="8,0,0,0" Content="{Binding Duration}" />
+ </StackPanel>
+ </StackPanel>
+ </StackPanel>
+
+
+ <!-- Destination -->
+ <StackPanel Grid.Row="1"
+ Margin="10,5,5,5"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ >
+ <Label Content="Destination" FontWeight="Bold" />
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <Label Margin="8,0,0,0" Content="File" />
+ <TextBox Name="Destination"
+ Grid.Column="1"
+ Margin="8,0,0,0"
+ Text="{Binding Destination,
+ UpdateSourceTrigger=PropertyChanged}"
+ />
+ <Button Name="DestinationBrowser"
+ Grid.Column="2"
+ Margin="8,0,5,0"
+ Padding="8,2"
+ Content="Browse"
+ cal:Message.Attach="[Event Click] = [Action BrowseDestination]"
+ />
+ </Grid>
+ </StackPanel>
+
+ <!-- Opitons -->
+ <StackPanel Grid.Row="2"
+ Margin="10,5,5,5"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ >
+ <Label Content="Options" FontWeight="Bold" />
+
+ <StackPanel Orientation="Horizontal" Margin="8,0,0,0">
+ <TextBlock Text="Preset:" Margin="0,0,5,0" />
+ <ComboBox ItemsSource="{Binding Presets}" SelectedItem="{Binding SelectedPreset}" MinWidth="150" />
+ </StackPanel>
+
+ </StackPanel>
+
+
+ <!-- Buttons and Queueing -->
+ <Grid Grid.Row="3" Margin="10,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+ <Label Content="Start" FontWeight="Bold" Grid.Row="0" />
+ <Button Content="Start Encoding" cal:Message.Attach="[Event Click] = [Action StartEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"
+ Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
+ <Button Content="Stop Encoding" cal:Message.Attach="[Event Click] = [Action StopEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"
+ Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+ </Grid>
+
+
+ <!-- StatusPanel -->
+ <controls:StatusPanel x:Name="loadingPanel"
+ Grid.Row="3"
+ Grid.RowSpan="2"
+ Height="70"
+ VerticalAlignment="Bottom"
+ Panel.ZIndex="10"
+ IsLoading="{Binding ShowStatusWindow}"
+ Message="{Binding StatusLabel}"
+ SubMessage="Please Wait ..."
+ />
+
+ <!-- Status Bar -->
+ <StatusBar Grid.Row="4" Grid.ColumnSpan="2" MinHeight="32" >
+
+ <ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"
+ Width="100" Height="18" VerticalAlignment="Center"/>
+ <Label VerticalAlignment="Center"
+ Content="{Binding Path=ProgramStatusLabel}" />
+
+ </StatusBar>
+
+ </Grid>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs new file mode 100644 index 000000000..4a74deba4 --- /dev/null +++ b/win/CS/HandBrakeWPF/Views/InstantMainView.xaml.cs @@ -0,0 +1,15 @@ +namespace HandBrakeWPF.Views
+{
+ using System.Windows.Controls;
+
+ /// <summary>
+ /// Interaction logic for InstantMainView.xaml
+ /// </summary>
+ public partial class InstantMainView : UserControl
+ {
+ public InstantMainView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 67ac70c21..38545de00 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -527,6 +527,7 @@ Margin="10,10,5,5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
+ MinHeight="350" MinWidth="720"
>
<TabItem Name="pictureTab" Header="Picture">
<ContentControl x:Name="PictureSettingsViewModel" />
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml index ae8d26747..43edcb36b 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:views="clr-namespace:HandBrakeWPF.Views"
Title="{Data:Binding Path=WindowTitle}"
Width="1015"
Height="670"
@@ -14,6 +15,7 @@ WindowStartupLocation="CenterScreen"
TextOptions.TextFormattingMode="Display"
Style="{StaticResource mainWindowStyle}"
+ x:Name="shellView"
>
<Window.Resources>
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
@@ -22,5 +24,8 @@ <Grid>
<ContentControl x:Name="MainViewModel" Visibility="{Binding ShowMainWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
<ContentControl x:Name="OptionsViewModel" Visibility="{Binding ShowOptions, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+
+ <views:InstantMainView DataContext="{Binding MainViewModel}"
+ Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ShowInstant, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
</Grid>
</Window>
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs index b1eff7ddd..067446f12 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs @@ -82,6 +82,14 @@ namespace HandBrakeWPF.Views {
this.TaskbarItemInfo = Win7.WindowsTaskbar;
}
+
+ // Window Sizing
+ if (AppArguments.IsInstantHandBrake)
+ {
+ this.SizeToContent = SizeToContent.WidthAndHeight;
+ this.MinHeight = 380;
+ this.MinWidth = 600;
+ }
}
/// <summary>
|