Binding visibility of a control to 'Count' of an IEnumerable

前端 未结 3 1743
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-19 08:55

I have a list of objects contained in an IEnumerable<>. I would like to set the visibility of a control based on the count of this list. I have tried:

 Visibi         


        
3条回答
  •  遥遥无期
    2021-02-19 09:39

    You should use a converter, which converts the Count property to a Visibility value, or perhaps a new "HasItems" boolean property to a Visibility value. We use something, for example, called boolToVisibilityConvert, to handle jobs like this.

    I can give you more precise details, if you need them.

提交回复
热议问题