mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 11:09:06 +00:00
.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace QuickLook.Plugin.ArchiveViewer
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ArchiveFileListView.xaml
|
||||
/// </summary>
|
||||
public partial class ArchiveFileListView : UserControl, IDisposable
|
||||
{
|
||||
public ArchiveFileListView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
IconManager.ClearCache();
|
||||
}
|
||||
|
||||
public void SetDataContext(object context)
|
||||
{
|
||||
treeGrid.DataContext = context;
|
||||
|
||||
treeView.Loaded += (sender, e) =>
|
||||
{
|
||||
// return when empty
|
||||
if (treeView.Items.Count == 0)
|
||||
return;
|
||||
|
||||
// return when there are more than one root nodes
|
||||
if (treeView.Items.Count > 1)
|
||||
return;
|
||||
|
||||
var root = (TreeViewItem) treeView.ItemContainerGenerator.ContainerFromItem(treeView.Items[0]);
|
||||
if (root == null)
|
||||
return;
|
||||
|
||||
root.IsExpanded = true;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user