5

Can someone tell me how can I add a CommandLink control in a WPF window?

This is what I mean by CommandLink : http://msdn.microsoft.com/en-us/library/aa511455.aspx

Elmo
  • 6,409
  • 16
  • 72
  • 140

1 Answers1

5

WPF Task Dialog Wrapper provides an implementation of a CommandLink user control.

Here's an example of how to show command links:

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 library is licensed under the The Code Project Open License.


Seven Update has another nice implementation of a CommandLink Button.

This is how it looks like:

Seven Update

Bear in mind that is a project licensed under the GPL v3 license.


This guide might help too:

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

Paolo Moretti
  • 54,162
  • 23
  • 101
  • 92
  • Are there any less time consuming solutions without copyleft licence? ;) – OneWorld Feb 27 '13 at 10:33
  • @OneWorld I've updated my answer with another library. You can edit my answer (or add your one) if you find something else you think is useful or worth sharing :) – Paolo Moretti Feb 27 '13 at 13:03
  • Thank you for your post. I imported the the library in my project. I could add the `` to my XAML, but now I have a hard time to adjust the text and icon to my needs. I also included the source project instead of the library in my project. But even then I can't get hold on the properties I need to adjust. – OneWorld Feb 28 '13 at 08:13