English 中文(简体)
WPF 树木 项目 Toggle Button知名度
原标题:WPF TreeViewItem Toggle Button visibility

我先谈一个问题,希望有人能帮助我解决问题。 我现在举一个例子,即我的节点含有一套儿童节点,其可见度是伪造的。 我希望,如果所有养育孩子的人都看不见,我就能够消除树苗中的 to。 这是可能的吗? 例如:

<TreeView Margin="10,10,0,13" Name="TreeView1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="194" Height="200">
    <TreeViewItem Header="Cold Drinks">
        <TreeViewItem Header="Coke" Visibility="False"></TreeViewItem>
        <TreeViewItem Header="Pepsi" Visibility="False"></TreeViewItem>
    </TreeViewItem>
</TreeView>

怎样才能使冷的 Drink树听起来掩盖 to的arrow子?

最佳回答

如果你看到树苗的衰败控制,你就会看到,托格林纽特的可见度受项目管制。 HasItems. 象这样的三叉 -:

<Trigger Property="ItemsControl.HasItems">
  <Setter TargetName="Expander" Property="UIElement.Visibility" Value="{x:Static Visibility.Hidden}" />
     <Trigger.Value>
        <s:Boolean>False</s:Boolean>
     </Trigger.Value>
</Trigger>

因此,作为一个工作领域,你可以自行建立由塔夫姆特制衍生的习俗控制,并将贵岛财产与你本人的财产相挂钩,这些财产将穿过你的所有子女情况(TreeViewItems),如果所有物品都藏匿/col落,则将归还真实情况。 这样,你的洞.将自动隐藏在Trigger。

如果你想要知道如何建立习俗控制,并把它与你的《刑法》财产联系起来,你可以提到这一点:

WPF 装饰/how扩展/孔隙

This is somewhat same what you has been looking for. Hope this helps..

问题回答

内部(即关键航道)和违约模板都以<>HasItems为根据,了解是否有子女。 你们很可能需要把树木的产物列入清单,并过滤已经崩溃的物品。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签