简体   繁体   中英

Tabitem visibility binding WPF

I'm trying to bind tab item visibility but it's nothing happening here is my code

<TabItem Header="{Binding tabVisibility}">

and in my view modal

public Visibility tabVisibility
        {
            get
            {
                return _visibility;
            }

            set
            {
                _visibility = value;
                NotifyPropertyChanged();
            }
        }
<TabItem Visibility="{Binding tabVisibility,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=TabControl}}">

Solved it. the problem is the property is in another view modal it was my mistake

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM