mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Add currently-unused player update from UI
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -120,6 +121,7 @@ namespace RedBookPlayer.GUI
|
||||
private void InitializeComponent(string xaml)
|
||||
{
|
||||
DataContext = new PlayerViewModel();
|
||||
(DataContext as PlayerViewModel).PropertyChanged += UpdateModel;
|
||||
|
||||
// Load the theme
|
||||
try
|
||||
@@ -189,6 +191,17 @@ namespace RedBookPlayer.GUI
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the Player with the most recent information from the UI
|
||||
/// </summary>
|
||||
private void UpdateModel(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
Player.UpdateModel(DataContext as PlayerViewModel);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the UI with the most recent information from the Player
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user