У меня есть класс со свойствами, основанными на выборе одного элемента в свойстве со списком, другие свойства будут отображаться или скрываться. Я использую [RefreshProperties(RefreshProperties.All)] для свойства поля со списком. Класс, привязанный к сетке свойств:
[TypeConverter(typeof(PropertySubsetConverter<FileSystemOperation>))]
public class FileSystemOperation : IPropertySubsetObject
{
[Description("File system operations like Copy, Move, Delete & Check file.")]
[Category("Mandatory")]
[RefreshProperties(RefreshProperties.All)]
public Op Operation { get; set; }
public enum Op
{
/// <summary>
/// Copy file
/// </summary>
CopyFile,
/// <summary>
/// Move file
/// </summary>
MoveFile,
/// <summary>
/// Delete file
/// </summary>
DeleteFile,
/// <summary>
/// Delete directory
/// </summary>
DeleteDirectory,
/// <summary>
/// Check if file exists
/// </summary>
ExistFile
}
}
если пользователь выбирает «DeleteDirectory», должно быть показано ниже свойство, а другие свойства должны быть скрыты
[AppliesTo(Op.DeleteDirectory)]
public bool Recursive { get; set; }
Мой Ксамл:
<xctk:PropertyGrid x:Name="pk" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontWeight="ExtraBold" IsEnabled="{Binding PropertyGridIsEnabled}" SelectedObject="{Binding SelectedElement, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Background="#FF4A5D80" Foreground="White"/>
Это работает с сеткой свойств Winform, но не работает с сеткой свойств Xceed wpf. Нужна помощь, если мне не хватает какого-либо свойства для установки.