WPF中的CommandLink

时间:2011-07-29 08:09:29

标签: c# wpf vb.net xaml commandlink

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

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

1 个答案:

答案 0 :(得分:6)

WPF Task Dialog Wrapper提供了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 Task Dialog Wrapper

该图书馆根据The Code Project Open License获得许可。


Seven Update有另一个很好的CommandLink按钮实现。

这就是它的样子:

Seven Update

请记住,这是根据GPL v3许可证授权的项目。


本指南也可能有所帮助:

Creating Command Link Controls in Silverlight with Expression Blend 3 and Behaviors