Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
7c5541de04
11 files changed
+101
-1328
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 变量传递至ui
|
||||
/// </summary>
|
||||
public class ViewModelBase : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected virtual void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
public void RaisePropertyChanged(string propertyName)
|
||||
{
|
||||
if (PropertyChanged != null)
|
||||
{
|
||||
if (propertyName != null)
|
||||
{
|
||||
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommonServiceLocator;
|
||||
|
||||
namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
{
|
||||
public class ViewModelLocator
|
||||
{
|
||||
public ViewModelLocator()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public MainWindowViewModel Main
|
||||
{
|
||||
get
|
||||
{
|
||||
return ServiceLocator.Current.GetInstance<MainWindowViewModel>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user