这种类型的静态 XAML 绑定如何工作?
How does this type of static XAML Binding work?
我在 XAML 文档中看到了以下代码,但我不理解语法,也不理解它应该如何工作。
XAML 包含以下绑定(或者我猜这是某种绑定):
<Button Content="Export all" Command="{atf:CommandService {x:Static MyProgramme:ExportCommands+Commands.ExportAll}}">
在这个项目中,有一个class确实叫做CommandService
(它很大所以我不能分享完整的代码,但请参阅the ATF framework),另一个class:
public class ExportCommands
{
private enum Commands
{
ExportAll
}
}
我不明白 XAML 表达式的语法。它如何将 CommandService
class 与实际命令相关联?是否有使用此语法的类似示例?
ATF CommandService 是框架提供的自定义 MarkupExtension
。可以找到标记扩展的示例 here
我在 XAML 文档中看到了以下代码,但我不理解语法,也不理解它应该如何工作。
XAML 包含以下绑定(或者我猜这是某种绑定):
<Button Content="Export all" Command="{atf:CommandService {x:Static MyProgramme:ExportCommands+Commands.ExportAll}}">
在这个项目中,有一个class确实叫做CommandService
(它很大所以我不能分享完整的代码,但请参阅the ATF framework),另一个class:
public class ExportCommands
{
private enum Commands
{
ExportAll
}
}
我不明白 XAML 表达式的语法。它如何将 CommandService
class 与实际命令相关联?是否有使用此语法的类似示例?
ATF CommandService 是框架提供的自定义 MarkupExtension
。可以找到标记扩展的示例 here