2012-08-05 00:10:44 +00:00
|
|
|
|
using System;
|
2012-08-19 21:49:14 +00:00
|
|
|
|
using System.Windows;
|
2012-08-25 17:05:41 +00:00
|
|
|
|
using MahApps.Metro.Controls;
|
2012-08-19 21:49:14 +00:00
|
|
|
|
using MediaBrowser.Common.Logging;
|
2012-08-05 00:10:44 +00:00
|
|
|
|
using MediaBrowser.Model.Progress;
|
|
|
|
|
|
2012-08-05 02:21:38 +00:00
|
|
|
|
namespace MediaBrowser.Common.UI
|
2012-08-05 00:10:44 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2012-08-05 02:21:38 +00:00
|
|
|
|
/// Interaction logic for Splash.xaml
|
2012-08-05 00:10:44 +00:00
|
|
|
|
/// </summary>
|
2012-08-25 17:05:41 +00:00
|
|
|
|
public partial class Splash : MetroWindow
|
2012-08-05 00:10:44 +00:00
|
|
|
|
{
|
2012-08-19 18:01:43 +00:00
|
|
|
|
public Splash(Progress<TaskProgress> progress)
|
2012-08-05 00:10:44 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2012-08-19 18:01:43 +00:00
|
|
|
|
|
|
|
|
|
progress.ProgressChanged += progress_ProgressChanged;
|
2012-08-25 17:05:41 +00:00
|
|
|
|
Loaded+=Splash_Loaded;
|
2012-08-19 18:01:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void progress_ProgressChanged(object sender, TaskProgress e)
|
|
|
|
|
{
|
2012-08-19 21:49:14 +00:00
|
|
|
|
// If logging has loaded, put a message in the log.
|
|
|
|
|
if (Logger.LoggerInstance != null)
|
|
|
|
|
{
|
|
|
|
|
Logger.LogInfo(e.Description);
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-19 18:01:43 +00:00
|
|
|
|
this.lblProgress.Content = e.Description;
|
|
|
|
|
this.pbProgress.Value = (double)e.PercentComplete;
|
2012-08-05 00:10:44 +00:00
|
|
|
|
}
|
2012-08-19 18:45:08 +00:00
|
|
|
|
|
|
|
|
|
private void Splash_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2012-08-25 17:05:41 +00:00
|
|
|
|
// Setting this in markup throws an exception at runtime
|
|
|
|
|
ShowTitleBar = false;
|
2012-08-19 18:45:08 +00:00
|
|
|
|
}
|
2012-08-05 00:10:44 +00:00
|
|
|
|
}
|
|
|
|
|
}
|