本文整理汇总了C#中System.Windows.Controls.TreeViewItem.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# TreeViewItem.GetValue方法的具体用法?C# TreeViewItem.GetValue怎么用?C# TreeViewItem.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.TreeViewItem
的用法示例。
在下文中一共展示了TreeViewItem.GetValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetConnectingLineInfo
/// <summary>
/// Gets the value of the ConnectingLineInfo attached property for a
/// specified TreeViewItem.
/// </summary>
/// <param name="element">
/// The TreeViewItem from which the property value is read.
/// </param>
/// <returns>
/// The ConnectingLineInfo property value for the TreeViewItem.
/// </returns>
internal static TreeViewItemConnectingLineInfo GetConnectingLineInfo(TreeViewItem element)
{
if (element == null)
{
throw new ArgumentNullException("element");
}
// Get the info and create on demand if necessary
TreeViewItemConnectingLineInfo info = element.GetValue(ConnectingLineInfoProperty) as TreeViewItemConnectingLineInfo;
if (info == null)
{
info = new TreeViewItemConnectingLineInfo(element);
element.SetValue(ConnectingLineInfoProperty, info);
}
return info;
}
示例2: GetIsBroughtIntoViewWhenSelected
public static bool GetIsBroughtIntoViewWhenSelected(TreeViewItem treeViewItem)
{
return (bool)treeViewItem.GetValue(IsBroughtIntoViewWhenSelectedProperty);
}
示例3: GetIsTreeViewItemDropOver
public static bool GetIsTreeViewItemDropOver(TreeViewItem item)
{
return (bool)item.GetValue(IsTreeViewItemDropOverProperty);
}
示例4: GetIsItemSelected
public static bool GetIsItemSelected(TreeViewItem element)
{
return (bool)element.GetValue(IsItemSelectedProperty);
}
示例5: GetBringSelectionIntoView
public static bool GetBringSelectionIntoView(TreeViewItem treeViewItem)
{
return (bool)treeViewItem.GetValue(BringSelectionIntoViewProperty);
}
示例6: GetIsFiltered
public static bool GetIsFiltered(TreeViewItem item)
{
return (bool)item.GetValue(IsFilteredProperty);
}
示例7: GetEnableContextMenuWorkaround
public static bool GetEnableContextMenuWorkaround(TreeViewItem treeViewItem)
=> (bool) treeViewItem.GetValue(EnableContextMenuWorkaroundProperty);
示例8: GetEnableFullRowSelection
public static bool GetEnableFullRowSelection(TreeViewItem treeViewItem)
=> (bool) treeViewItem.GetValue(EnableFullRowSelectionProperty);
示例9: GetBringIntoViewWhenSelected
public static bool GetBringIntoViewWhenSelected(TreeViewItem treeViewItem)
{
return (bool)treeViewItem.GetValue(BringIntoViewWhenSelectedProperty);
}
示例10: GetAssociatedToolbarItem
/// <summary>
/// Gets the value of the AssociatedToolbarItem attached property for a specified TreeViewItem.
/// </summary>
/// <param name="element">The TreeViewItem from which the property value is read.</param>
/// <returns>The AssociatedToolbarItem property value for the TreeViewItem.</returns>
internal static AddToolbarItem GetAssociatedToolbarItem(TreeViewItem element)
{
if (element == null)
{
throw new ArgumentNullException("element");
}
return element.GetValue(AssociatedToolbarItemProperty) as AddToolbarItem;
}
示例11: getParentConnectionForTreeViewItem
private Connection getParentConnectionForTreeViewItem(TreeViewItem item)
{
if (item == null)
return null;
Resource resource = item.DataContext as Resource;
if (resource != null)
{
Connection c = item.GetValue(TreeViewItemExtensions.ConnectionProperty) as Connection;
if (c != null)
return c;
}
Connection ds = item.DataContext as Connection;
if (ds != null)
return ds;
TreeViewItem parent = item.Parent as TreeViewItem;
if (parent == null)
parent = ControlTreeHelper.FindAncestorOfType<TreeViewItem>(item);
if (parent == null)
return null;
return getParentConnectionForTreeViewItem(parent);
}