Skip to content

Commit f77a349

Browse files
author
RandomEngy
committed
Fix issue where old window objects would stick around and continue to respond
to property change events and mess things up. --HG-- branch : beta
1 parent d396a95 commit f77a349

10 files changed

Lines changed: 20 additions & 25 deletions

Installer/latest-beta.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<UpdateInfo>
22
<Release>
3-
<Latest>1.4.0</Latest>
4-
<DownloadLocation>http://engy.us/VidCoder/VidCoder-1.4.0-Beta-x86.exe</DownloadLocation>
5-
<ChangelogLocation>http://vidcoder.codeplex.com/releases/view/94767</ChangelogLocation>
3+
<Latest>1.4.1</Latest>
4+
<DownloadLocation>http://engy.us/VidCoder/VidCoder-1.4.1-Beta-x86.exe</DownloadLocation>
5+
<ChangelogLocation>http://vidcoder.codeplex.com/releases/view/95207</ChangelogLocation>
66
</Release>
77
<Release-x64>
8-
<Latest>1.4.0</Latest>
9-
<DownloadLocation>http://engy.us/VidCoder/VidCoder-1.4.0-Beta-x64.exe</DownloadLocation>
10-
<ChangelogLocation>http://vidcoder.codeplex.com/releases/view/94767</ChangelogLocation>
8+
<Latest>1.4.1</Latest>
9+
<DownloadLocation>http://engy.us/VidCoder/VidCoder-1.4.1-Beta-x64.exe</DownloadLocation>
10+
<ChangelogLocation>http://vidcoder.codeplex.com/releases/view/95207</ChangelogLocation>
1111
</Release-x64>
1212
</UpdateInfo>

VidCoder/Converters/FramerateDisplayConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class FramerateDisplayConverter : IValueConverter
1111
{
1212
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
1313
{
14-
if (value == null)
14+
if (value == null || value as string == string.Empty)
1515
{
1616
return string.Empty;
1717
}

VidCoder/View/AboutDialog.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<TextBlock HorizontalAlignment="Left" Name="versionLabel" Text="Version" VerticalAlignment="Top" />
1515
<TextBlock Text="{Binding Version}" Margin="5,0,0,0" Name="versionText" />
1616
</StackPanel>
17-
<TextBlock Height="23" HorizontalAlignment="Left" Margin="171,79,0,0" Name="textBlock3" Text="Based on HandBrake (svn 4937)" VerticalAlignment="Top" />
17+
<TextBlock Height="23" HorizontalAlignment="Left" Margin="171,79,0,0" Name="textBlock3" Text="Based on HandBrake (svn 4971)" VerticalAlignment="Top" />
1818
<TextBlock Height="23" HorizontalAlignment="Left" Margin="171,108,0,0" Name="textBlock2" Text="© 2010-2012 VidCoder Developers" VerticalAlignment="Top" />
1919
<Label Content="License:" Height="28" HorizontalAlignment="Left" Margin="12,138,0,0" Name="label1" VerticalAlignment="Top" />
2020

VidCoder/View/EncodingWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Title="{Binding WindowTitle}" Width="671" Height="467" MinWidth="588" MinHeight="467"
1313
Style="{StaticResource NormalWindow}" WindowStartupLocation="CenterOwner"
1414
Closing="Window_Closing"
15-
ShowInTaskbar="False" WindowStyle="ToolWindow">
15+
ShowInTaskbar="False" WindowStyle="ToolWindow" Closed="Window_Closed">
1616
<Window.Resources>
1717
<local:EnumDisplayer Type="{x:Type Encoding:Container}" x:Key="OutputFormatChoices" />
1818
</Window.Resources>

VidCoder/View/EncodingWindow.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,10 @@ private void ToolBar_Loaded(object sender, RoutedEventArgs e)
6464
{
6565
UIUtilities.HideOverflowGrid(sender as ToolBar);
6666
}
67+
68+
private void Window_Closed(object sender, EventArgs e)
69+
{
70+
this.DataContext = null;
71+
}
6772
}
6873
}

VidCoder/View/OptionsDialog.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Model="clr-namespace:VidCoder.Model" Title="Options" Height="415" Width="571"
44
xmlns:resx="clr-namespace:VidCoder.Properties"
5-
Style="{StaticResource NormalWindow}" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Closing="Window_Closing" xmlns:my="clr-namespace:VidCoder.Controls">
5+
Style="{StaticResource NormalWindow}" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Closing="Window_Closing" xmlns:my="clr-namespace:VidCoder.Controls" Closed="Window_Closed">
66
<Window.Resources>
77
<Style x:Key="EmphasizedTitle" TargetType="TextBlock">
88
<Setter Property="VerticalAlignment" Value="Center" />

VidCoder/View/OptionsDialog.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,10 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
3333
Settings.Default.OptionsDialogLastTab = this.tabControl.SelectedIndex;
3434
Settings.Default.Save();
3535
}
36+
37+
private void Window_Closed(object sender, EventArgs e)
38+
{
39+
this.DataContext = null;
40+
}
3641
}
3742
}

VidCoder/ViewModel/OkCancelDialogViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,9 @@ public virtual void OnClosing()
2626
this.Closing();
2727
}
2828

29-
this.Closed = true;
3029
WindowManager.ReportClosed(this);
3130
}
3231

33-
public bool Closed { get; set; }
34-
3532
public bool DialogResult { get; set; }
3633
public Action Closing { get; set; }
3734

VidCoder/ViewModel/OptionsDialogViewModel.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,6 @@ public bool MinimizeToTray
350350

351351
set
352352
{
353-
// WPF will sometimes fire the setter after the window has closed.
354-
if (this.Closed)
355-
{
356-
return;
357-
}
358-
359353
this.minimizeToTray = value;
360354
this.RaisePropertyChanged(() => this.MinimizeToTray);
361355
}

VidCoder/ViewModel/Panels/VideoPanelViewModel.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,6 @@ public bool ConstantFramerate
266266

267267
set
268268
{
269-
// WPF will errantly try to set this sometimes after it's closed
270-
if (this.EncodingViewModel.Closed)
271-
{
272-
return;
273-
}
274-
275269
this.Profile.ConstantFramerate = value;
276270
this.RaisePropertyChanged(() => this.ConstantFramerate);
277271
this.IsModified = true;

0 commit comments

Comments
 (0)