Laservall_solidworks_inject/Windows/ViewModel/ItemsViewModel.cs

116 lines
2.9 KiB
C#
Raw Normal View History

using Laservall.Solidworks.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Laservall.Solidworks.Windows.ViewModel
{
public class ItemsViewModel : INotifyPropertyChanged
{
#region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
public ItemsViewModel()
{
}
private ObservableCollection<SwAssDocTreeModel> swAssDocTrees;
public ObservableCollection<SwAssDocTreeModel> SwAssDocTrees
{
get { return swAssDocTrees; }
set
{
swAssDocTrees = value;
OnPropertyChanged();
}
}
private ObservableCollection<BomItemModel> bomItems;
public ObservableCollection<BomItemModel> BomItems
{
get { return bomItems; }
set
{
bomItems = value;
OnPropertyChanged();
}
}
private List<string> allPropertyKeys = new List<string>();
public List<string> AllPropertyKeys
{
get { return allPropertyKeys; }
set
{
allPropertyKeys = value;
OnPropertyChanged();
}
}
private bool isLoading = true;
public bool IsLoading
{
get { return isLoading; }
set
{
isLoading = value;
OnPropertyChanged();
}
}
private double loadingProgress;
public double LoadingProgress
{
get { return loadingProgress; }
set
{
loadingProgress = value;
OnPropertyChanged();
}
}
private double loadingProgressMaximum = 1;
public double LoadingProgressMaximum
{
get { return loadingProgressMaximum; }
set
{
loadingProgressMaximum = value <= 0 ? 1 : value;
OnPropertyChanged();
}
}
private string loadingText = "正在读取数据...";
public string LoadingText
{
get { return loadingText; }
set
{
loadingText = value;
OnPropertyChanged();
}
}
private bool isFlatView;
public bool IsFlatView
{
get { return isFlatView; }
set
{
isFlatView = value;
OnPropertyChanged();
}
}
}
}