如何在C#中使用和访问listboxitem的isvisible属性 [英] How do I use and access the isvisible property for a listboxitem in C#

查看:195
本文介绍了如何在C#中使用和访问listboxitem的isvisible属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试访问某些ListBox中的ListBoxItems的isVisible属性。 ListBoxItem的Microsoft Docs说IsVisible属性是一个依赖属性。阅读有关依赖属性的文档后,我仍然不清楚如何实现和访问该属性。任何想法将不胜感激。谢谢。



我尝试过:



我读过关于依赖属性的一些文档,但目前还不清楚如何实现它。似乎有人可以设置自己的依赖属性,但是如果这个属性已经存在(它是否有某种默认实现),那么我想访问并使用它。

解决方案

isVisible是Visibilty属性状态的getter。



设置Visibility属性以影响isVisible属性。

I'm trying to access the isVisible property for the ListBoxItems in some of my ListBoxes. The Microsoft Docs for the ListBoxItem say the IsVisible property is a Dependency Property. After reading the document on Dependency Properties, I'm still not clear on how to implement and access that property. Any ideas would be greatly appreciated. Thanks.

What I have tried:

I've read some of the documentation on Dependency Properties, but it's still not clear how to implement this. It appears that somebody could setup there own dependency properties, but if this one already exists (does it have some sort of default implementation), then I'd like to access and use it.

解决方案

isVisible is a "getter" for the "state" of the Visibilty property.

Set the Visibility property to affect the isVisible property.


这篇关于如何在C#中使用和访问listboxitem的isvisible属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆