47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
namespace JD.Oasis.Module.ViewModel.TreeViewModel.Common
|
|
{
|
|
/// <summary>
|
|
/// Provides a common implementation of a tree node model that supports checking.
|
|
/// </summary>
|
|
public class CheckableTreeNodeViewModel : TreeNodeViewModel
|
|
{
|
|
private bool _isCheckable;
|
|
private bool? _isChecked = false;
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// CONSTRUCTOR
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
public CheckableTreeNodeViewModel(string name) : base(name)
|
|
{}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// PUBLIC PROCEDURES
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
/// <summary>
|
|
/// Gets or sets whether the node is checkable.
|
|
/// </summary>
|
|
/// <value>
|
|
/// <c>true</c> if the node is checkable; otherwise, <c>false</c>.
|
|
/// </value>
|
|
public bool IsCheckable
|
|
{
|
|
get => _isCheckable;
|
|
set => SetProperty(ref _isCheckable, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets whether the node is checked.
|
|
/// </summary>
|
|
/// <value>
|
|
/// <c>true</c> if the node is checked; otherwise, <c>false</c>.
|
|
/// </value>
|
|
public bool? IsChecked
|
|
{
|
|
get => _isChecked;
|
|
set => SetProperty(ref _isChecked, value);
|
|
}
|
|
|
|
}
|
|
}
|