PersistentWindows/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.WpfShell/DiagnosticsView.xaml.cs
Min Yong Kim 9409d20445 1. Modification to make the application run in the systray
2. Abstracting processor and winapi logic into common dll and entry points into separate dlls
3. Adding icons
4. Switching build platform to AnyCPU. Seems to work on x64, don't have a x86 platform to test on
2015-02-27 00:38:08 -05:00

38 lines
1.2 KiB
C#

using System.Windows;
using System.Windows.Controls;
using NLog;
using Ninjacrab.PersistentWindows.Common.Diagnostics;
namespace Ninjacrab.PersistentWindows.WpfShell
{
/// <summary>
/// Interaction logic for DiagnosticsView.xaml
/// </summary>
public partial class DiagnosticsView : UserControl
{
private DiagnosticsViewModel viewModel;
public DiagnosticsView()
{
InitializeComponent();
viewModel = new DiagnosticsViewModel();
this.DataContext = viewModel;
Log.LogEvent += (level, message) =>
{
if (level != LogLevel.Trace)
{
this.Dispatcher.Invoke(() =>
{
viewModel.EventLog.Add(string.Format("{0}: {1}", level, message));
if (viewModel.EventLog.Count > 500)
{
viewModel.EventLog.RemoveAt(0);
}
eventLogList.ScrollIntoView(viewModel.EventLog[viewModel.EventLog.Count - 1]);
});
}
};
}
}
}