mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Added layer properties to core and hooked it up with the UI
Implemented timeline caret scrolling logic Added special treeview style for the layer properties tree
This commit is contained in:
1 parent
14065bffef
commit
59f0062c97
48 files changed
+618
-381
No files matched your search
@@ -0,0 +1,24 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Artemis.UI.Extensions
|
||||
{
|
||||
public static class TreeViewItemExtensions
|
||||
{
|
||||
public static int GetDepth(this TreeViewItem item)
|
||||
{
|
||||
TreeViewItem parent;
|
||||
while ((parent = GetParent(item)) != null)
|
||||
return GetDepth(parent) + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static TreeViewItem GetParent(TreeViewItem item)
|
||||
{
|
||||
var parent = VisualTreeHelper.GetParent(item);
|
||||
while (!(parent is TreeViewItem || parent is TreeView))
|
||||
parent = VisualTreeHelper.GetParent(parent);
|
||||
return parent as TreeViewItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user