Sic.Framework/MECF.Framework.UI.Client/RecipeEditorLib/RecipeModel/Params/PathFileParam.cs

45 lines
1.1 KiB
C#

using System;
namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
{
public class PathFileParam : ParamBaseWithGenericValue<string>
{
public override string Value
{
get => _value;
set
{
Set(ref _value, value);
ColumnPermChangedCallback?.Invoke(this);
if (string.IsNullOrEmpty(_value))
{
FileName = "";
}
else
{
var index = _value.LastIndexOf("\\", StringComparison.Ordinal);
FileName = index > -1 ? _value.Substring(index + 1) : _value;
}
IsSaved = false;
}
}
private string _fileName;
public string FileName
{
get => _fileName;
set => Set(ref _fileName, value);
}
private string _prefixPath;
public string PrefixPath
{
get => _prefixPath;
set => Set(ref _prefixPath, value);
}
}
}