WPF Control Hints ListBox : 怎样在一个ListBoxItem上应用命名Style

我们可以定义一个ListBoxItem的style,然后这个style就会被应用到style作用范围内的所有ListBoxItem,这个大家都了解。但是如果如果我们想吧这个style命名,然后应用到某个特定的ListBox呢?我们应该吧这个style应用到什么地方?

我们可以这么做:

<ListBox ItemContainerStyle="{StaticResource listBoxItemStyle}"/>

我会把工作中遇到的和控件相关的知识点,持续更新上来,共同学习,少走弯路。

原文地址:https://www.cnblogs.com/KeithWang/p/2267559.html