summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/Views/MainView.xaml.cs')
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
index 165e74923..347b83547 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs
@@ -11,6 +11,10 @@ namespace HandBrakeWPF.Views
{
using System.Windows;
+ using HandBrake.ApplicationServices.Model;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
/// <summary>
/// Interaction logic for MainView.xaml
/// </summary>
@@ -23,5 +27,31 @@ namespace HandBrakeWPF.Views
{
InitializeComponent();
}
+
+ /// <summary>
+ /// Gets ViewModel.
+ /// </summary>
+ private IMainViewModel ViewModel
+ {
+ get
+ {
+ return ((IMainViewModel)this.DataContext);
+ }
+ }
+
+ /// <summary>
+ /// Set the Selected Preset Property.
+ /// The SelectedItem property of a treeview is readonly.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The RoutedPropertyChangedEventArgs.
+ /// </param>
+ private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
+ {
+ this.ViewModel.SelectedPreset = e.NewValue as Preset;
+ }
}
}