csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
// -----------------------------------------------------------------------
|
|
// <copyright file="TreeView.cs" company="Steven Kirk">
|
|
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|
// </copyright>
|
|
// -----------------------------------------------------------------------
|
|
|
|
namespace Perspex.Controls
|
|
{
|
|
using System.Linq;
|
|
using System.Reactive.Linq;
|
|
using Perspex.Controls.Generators;
|
|
using Perspex.Controls.Presenters;
|
|
using Perspex.Controls.Primitives;
|
|
using Perspex.Input;
|
|
|
|
public class TreeView : SelectingItemsControl
|
|
{
|
|
protected override ItemContainerGenerator CreateItemContainerGenerator()
|
|
{
|
|
return new TreeItemContainerGenerator<TreeViewItem>(this);
|
|
}
|
|
|
|
//protected override void OnPointerPressed(PointerEventArgs e)
|
|
//{
|
|
// IVisual source = (IVisual)e.Source;
|
|
// ContentPresenter contentPresenter = source.GetVisualAncestors()
|
|
// .OfType<ContentPresenter>()
|
|
// .FirstOrDefault();
|
|
|
|
// if (contentPresenter != null)
|
|
// {
|
|
// TreeViewItem container = contentPresenter.TemplatedParent as TreeViewItem;
|
|
|
|
// if (container != null)
|
|
// {
|
|
// foreach (var i in this.GetVisualDescendents().OfType<TreeViewItem>())
|
|
// {
|
|
// i.IsSelected = i == container;
|
|
// }
|
|
|
|
// this.SelectedItem = this.ItemContainerGenerator.GetItemForContainer(container);
|
|
// }
|
|
// }
|
|
|
|
//}
|
|
}
|
|
}
|
|
|