调整代码
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ShrlAlgoToolkit.RevitAddins.Common.Controls
|
||||
{
|
||||
partial class ProgressMonitorViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
public partial int MaxValue { get; set; } = 100;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial int CurrentValue { get; set; } = 0;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string CurrentContext { get; set; } = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string Title { get; set; } = "处理任务";
|
||||
|
||||
public void NotifyUI()
|
||||
{
|
||||
var classType = this.GetType();
|
||||
if (classType != null)
|
||||
{
|
||||
var currentProperties = classType.GetProperties();
|
||||
foreach (var currentProperty in currentProperties)
|
||||
OnPropertyChanged(currentProperty.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user