diff options
author | sr55 <[email protected]> | 2011-05-22 10:51:43 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-05-22 10:51:43 +0000 |
commit | 33e7b795da3d10587d6fa4aa24c0cdfd1820f51c (patch) | |
tree | d9f51f8b4954f2de1763e879d4ce3db6bfffcc47 /win/CS/Controls/AudioPanel.cs | |
parent | 63e80e047737e4bc471dcf809c661f197ab89c67 (diff) |
WinGui: Fix an unusual issue with the DataBinding on the AudioTrack dropdown control. Seems to no longer get the ListChanged events when the model object is marked as serializable.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3994 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/Controls/AudioPanel.cs')
-rw-r--r-- | win/CS/Controls/AudioPanel.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs index a77294c5d..20f4a0908 100644 --- a/win/CS/Controls/AudioPanel.cs +++ b/win/CS/Controls/AudioPanel.cs @@ -7,6 +7,7 @@ namespace Handbrake.Controls {
using System;
using System.Collections.Generic;
+ using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
@@ -41,7 +42,7 @@ namespace Handbrake.Controls {
InitializeComponent();
- this.ScannedTracks = new BindingList<Audio>
+ this.ScannedTracks = new ObservableCollection<Audio>
{
AudioHelper.NoneFound
};
@@ -66,7 +67,7 @@ namespace Handbrake.Controls #region Properties
- public BindingList<Audio> ScannedTracks { get; set; }
+ public ObservableCollection<Audio> ScannedTracks { get; set; }
/// <summary>
/// Gets the AudioTracks Collection
@@ -200,10 +201,8 @@ namespace Handbrake.Controls // Setup the Audio track source dropdown with the new audio tracks.
this.ScannedTracks.Clear();
this.drp_audioTrack.SelectedItem = null;
- foreach (var item in selectedTitle.AudioTracks)
- {
- this.ScannedTracks.Add(item);
- }
+ this.ScannedTracks = new ObservableCollection<Audio>(selectedTitle.AudioTracks);
+ drp_audioTrack.DataSource = this.ScannedTracks;
drp_audioTrack.SelectedItem = this.ScannedTracks.FirstOrDefault();
this.drp_audioTrack.Refresh();
|