You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using MySql.Data.MySqlClient;
|
|
using Prism.Events;
|
|
using Prism.Mvvm;
|
|
using Txgy.FilesWatcher.model;
|
|
|
|
namespace Txgy.FilesWatcher.ViewModels
|
|
{
|
|
public class MainWindowViewModel : BindableBase
|
|
{
|
|
|
|
public MainWindowViewModel(IEventAggregator ea)
|
|
{
|
|
this._ea = ea;
|
|
_ea.GetEvent<LoadingEvent>().Subscribe(OnShowLoading, ThreadOption.UIThread);
|
|
}
|
|
private string _title = "FileWatch_20240509";
|
|
private readonly IEventAggregator _ea;
|
|
|
|
public string Title
|
|
{
|
|
get { return _title; }
|
|
set { SetProperty(ref _title, value); }
|
|
}
|
|
private string isLoadingVisibile = "Hidden";
|
|
|
|
public string IsLoadingVisibile
|
|
{
|
|
get { return isLoadingVisibile; }
|
|
set { SetProperty(ref isLoadingVisibile, value); }
|
|
}
|
|
|
|
private string _loadingMessage;
|
|
|
|
public string LoadingMessage
|
|
{
|
|
get { return _loadingMessage; }
|
|
set { SetProperty(ref _loadingMessage, value); }
|
|
}
|
|
|
|
private void OnShowLoading(LoadingPayload msg)
|
|
{
|
|
this.IsLoadingVisibile = msg.IsShow? "Visible" : "Hidden";
|
|
this.LoadingMessage = msg.Message;
|
|
}
|
|
}
|
|
}
|