- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
WPF 4 包括一个“TaskbarItemInfo”Freezable 类,该类将附加属性添加到允许更改各种 Windows 7 任务栏项目的窗口。
特别是,我正在尝试在窗口的 tasbar 图标上设置进度信息。我想使用 DataTrigger 来执行此操作,但它似乎不起作用。我尝试使用简单的样式 setter ,但这也不起作用 - 只有直接属性分配或直接属性绑定(bind)才能起作用。
例如:
<Window.Style>
<Style>
<Setter Property="TaskbarItemInfo.ProgressState" Value="Indeterminate" />
</Style>
</Window.Style>
<Window.TaskbarItemInfo>
<TaskbarItemInfo />
</Window.TaskbarItemInfo>
最佳答案
TaskbarItemInfo
不继承自 FrameworkElement
所以没有Style
属性供您在 DataTrigger
中设置.
你为什么不绑定(bind)你的TaskbarItemInfo
的ProgressState
到您想在 DataTrigger
中使用的属性然后使用 ValueConverter
将其转换为相关的 TaskbarItemProgressState
.
<Window.TaskbarItemInfo>
<TaskbarItemInfo ProgressState="{Binding YourProperty, Mode=OneWay, Converter={StaticResource ProgressStateConverter}}" />
</Window.TaskbarItemInfo>
TaskbarItemProgressState
适用于您的触发器属性。
关于wpf - 通过 WPF 样式或触发器设置 TaskbarItemInfo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9417499/
如屏幕截图所示,我的 ProgressBar1.Value 正确更新,但不是我的 TaskbarItemInfo.ProgressValue: 这是我用来更新两者的代码: void bw_Progre
如何在我的 Windows 通用应用程序中定义 TaskbarItemInfo? 我想在显示应用程序缩略图时添加自定义媒体播放按钮。 最佳答案 Nikolay,默认情况下它们是禁用的。您必须通过该语句
WPF 4 包括一个“TaskbarItemInfo”Freezable 类,该类将附加属性添加到允许更改各种 Windows 7 任务栏项目的窗口。 特别是,我正在尝试在窗口的 tasbar 图标上
据我了解,使用 Windows API 代码包的 JumpList 实现现在已被弃用,因为 Microsoft 现在通过 Microsoft .NET Framework 4.0 直接支持 JumpL
我是一名优秀的程序员,十分优秀!