TreeView没有BrigToFront

TreeView没有BrigToFront

本文介绍了TreeView没有BrigToFront(TreeViewItem)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用树,并且我将层次数据绑定到树中的HierarchicalDataTemplate

Hi all,

I am working with tree and i have Hierarchical Data bind to HierarchicalDataTemplate in the tree

<treeview flowdirection="RightToLeft" name="tree" itemssource="{Binding Jobs}">
            <treeview.itemtemplate>
                <hierarchicaldatatemplate itemssource="{Binding Childs}">
                    <border>
                        <stackpanel orientation="Horizontal">
                            <textblock margin="2" text="{Binding Name}" />
                        </stackpanel>
                    </border>
                </hierarchicaldatatemplate>
            </treeview.itemtemplate>
    </treeview>


我有Job对象,我想带那个对象查看,我该怎么办,


and i have Job object, i want to Bring that object to view, what should i do,

any help Please.

推荐答案


public bool IsExpanded
{
get{return _isExpanded;}
set
{
if(value!=_isExpanded;)
_isExpanded=value;
if(Parent!=null && _isExpanded == true)
Parent.IsExpanded = true; 
}
}


3-将此内容写入TreeView中的XAML


3- write this to your XAML in the TreeView

<style targettype="{x:Type">
    <setter property="IsSelected" value="{Binging IsSelected,Mode=TowWay}" />
    <setter property="IsExpanded" value="{Binging IsExpanded,Mode=TowWay}" />
</style>


这篇关于TreeView没有BrigToFront(TreeViewItem)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 23:48