5

有人能告诉我如何在 WPF 窗口中添加 CommandLink 控件吗?

这就是我所说的 CommandLink 的意思:http: //msdn.microsoft.com/en-us/library/aa511455.aspx

4

1 回答 1

6

WPF 任务对话框包装器提供了CommandLink用户控件的实现。

以下是如何显示命令链接的示例:

TaskDialogOptions config = new TaskDialogOptions();

config.Owner = this;
config.Title = "RadioBox Title";
config.MainInstruction = "The main instruction text for the TaskDialog goes here.";
config.Content = "The content text for the task dialog is shown here "
               + "and the text will automatically wrap as needed.";
config.ExpandedInfo = "Any expanded content text for the task dialog "

                    + "is shown here and the text will automatically wrap as needed.";
config.CommandButtons = new string[] {
    "Command &Link 1", "Command Link 2\nLine 2\nLine 3", "Command Link 3" };
config.MainIcon = VistaTaskDialogIcon.Information;

TaskDialogResult res = TaskDialog.Show(config);

WPF 任务对话框包装器

该库在 The Code Project Open License 下获得许可。


Seven Update有另一个很好的CommandLinkButton 实现。

这是它的样子:

七更新

请记住,这是一个根据 GPL v3 许可许可的项目。


本指南也可能有所帮助:

在 Silverlight 中使用 Expression Blend 3 和行为创建命令链接控件

于 2011-07-29T11:00:21.533 回答