mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-23 02:51:26 -07:00
31 lines
909 B
C#
31 lines
909 B
C#
using System.Windows;
|
|
using System.Windows.Input;
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
namespace Bloxstrap.UI.ViewModels.ContextMenu
|
|
{
|
|
internal class LogTracerViewModel : NotifyPropertyChangedViewModel
|
|
{
|
|
private readonly Window _window;
|
|
private readonly RobloxActivity _activityWatcher;
|
|
|
|
public ICommand CloseWindowCommand => new RelayCommand(_window.Close);
|
|
|
|
public string LogLocation => _activityWatcher.LogFilename;
|
|
public string LogContents { get; private set; } = "";
|
|
|
|
public LogTracerViewModel(Window window, RobloxActivity activityWatcher)
|
|
{
|
|
_window = window;
|
|
_activityWatcher = activityWatcher;
|
|
|
|
_activityWatcher.OnLogEntry += (_, message) =>
|
|
{
|
|
LogContents += message += "\r\n";
|
|
OnPropertyChanged(nameof(LogContents));
|
|
};
|
|
}
|
|
}
|
|
}
|