Хочу сделать TreeView но в таком виде и с нуля
Пока пытаюсь скопировать ListBox но не получается сделать биндинг к Items
public partial class TreeListBox : UserControl {
public TreeListBox() {
InitializeComponent();
this.Items = new DataGrid().Items;
this.Items.Add(new object());
}
public IEnumerable ItemsSource {
get => (IEnumerable)GetValue(ItemsSourceProperty);
set => SetValue(ItemsSourceProperty, value);
}
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register("ItemsSource", typeof(IEnumerable),
typeof(TreeListBox), new FrameworkPropertyMetadata(null,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
[Bindable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public ItemCollection Items { get; }
}
Как создавать подобные User Control'ы?
Основные этапы разработки сайта для стоматологической клиники
Продвижение своими сайтами как стратегия роста и независимости