问题标签 [itemcontainerstyle]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
wpf - 如何突出显示 IsSelected 的行
当我从我的选择时,我想突出显示该行,ListView
但我无法让它工作。谁能看看我所拥有的并告诉我我做错了什么?另一个问题是如何在我的 ViewModel 中拥有一个属性并Background
根据 bool 值设置颜色,如何实现?
wpf - 如何只为 TreeView 的第一级设置 ItemContainerStyle?
我只想更改ItemContainerStyle
第一级的项目。并为更深层次保留默认样式。有可能吗?
wpf - 扩展自定义 TreeView 项目容器样式?
如何扩展我在 CustomTreeView 中声明的样式?所以我有一个浅灰色的前景和一个绿色的背景?
CustomTreeView.xaml
窗口.xaml
c# - WPF - 从触发器访问子级
我有一个ListBox
像我在那里展示的声明。关键是在项目定义中我有很多关于网格和元素的东西。我只想更改项目中一个图像的可见性,使其仅在选择元素本身时可见。
例如,当项目被选中时,我设法更改了项目的背景和总体外观,但我无法访问内部元素:(
我尝试使用:
但它不能在样式设置器上设置。有什么线索吗?
整个设计相当复杂,所以我想尽可能避免重新编码。
wpf - ItemContainterStyle 中的数据绑定 - WPF - MVVM Light
我正在创建一个带有使用网格的 ItemContainer 的自定义 ListBox。目标是将每个项目添加到特定的列、行,并具有特定的行跨度。这些数字在 ObservableCollection ScheduledCourses 中设置为可绑定属性。在 DataTemplate 上,我能够指定 DataType,然后能够从集合中进行绑定。但我无法在 Style 上指定 DataType。如何设置 BlockPlacement 中的值以绑定所需的属性?
PS。我正在使用 MVVM Light。
.net - Remove Highlight Effect from ListViewItem
In a ListView
there are ListviewItems
where they must not change appearance when the mouse is over them or they are selected.
I tried to accomplish that with this style and did somewhat succeed:
But the it raised a new issue. When the background is set to "Transparent" I am now able to see this hover/glossy effect that is shown at the picture below, when the mouse is over a list view item.
I have tried to solve the problem with this attempt, but with no luck.
Anyone have an idea how to remove this hover effect?
wpf - WPF ListBox 中的 ItemTemplate 和 ItemContainerStyle 有什么区别?
在 WPF中,Listbox
我对这两个概念感到困惑:
有人可以解释一下吗?ItemTemplate
ItemContainerStyle
wpf - WPF:如何从 ItemContainerStyle 中的基本(或默认)样式继承
我在从 TabControl 的 ItemContainerStyle 中的默认样式继承时遇到问题。
目的是继承主题风格,只改变一些属性。
如果我编写此 XAML 代码,则使用默认的 TabItem 样式,但不使用主题样式。你知道为什么吗?
PS:对资源中的按钮做同样的事情,效果很好。为什么它没有 TabItem 样式?与 ItemContainerStyle 有什么关系?
PS2:我的主题风格(默认风格)是存储在应用资源中的。
谢谢
编辑 1
您可以在我的 dropbox 上找到示例项目: https ://dl.dropboxusercontent.com/u/61987557/InheritDefaultStyle.zip
c# - 菜单项不会显示上下文菜单
我有一个按钮,单击时会显示一个 ContextMenu。在这个 ContextMenu 中,我有 MenuItems。如果左键单击 MenuItem,它应该执行一个命令。到目前为止,所有这些行为都可以使用以下代码正常工作:
现在我希望每个菜单项都有一个带有一个 MenuItem 的上下文菜单。由于左键单击会调用 MenuItem 上的命令,因此我希望右键单击行为显示以下 ContextMenu:
我试着把它作为一个设置器放在 ItemContainerStyle 中。我还尝试将其作为 MenuItem 的 ContextMenu,但我的任何尝试都没有奏效。我确信我可以想出一个 hacky 方法来做到这一点,但我想让它保持干净和简单。
wpf - Telerik Tile 背景绑定
我正在尝试将 Tile 的背景绑定在 a 中RadTileList
,Tiles 是从 Itemsource 上的集合创建的RadTileList
,到目前为止,我已经尝试在 中更改边框容器的背景Datatemplate
,但似乎 Tile 背景属性正在赢得这一点。
在上面的代码中,我尝试设置ItemContainerStyle
并设置背景绑定,但没有任何变化,希望有人能帮助我。
注意:背景的颜色是一个字符串变量,所以我使用转换器,我独立测试过