This project has moved and is read-only. For the latest updates, please go here.

Adding CommandLinks through XAML

Dec 17, 2008 at 12:46 PM
Edited Dec 17, 2008 at 12:47 PM
Is it possible to add TaskDialogButtonData objects to a TaskDialog in XAML like this:

        <av:TaskDialogButtonData Value="1" Header="Yes, do it" />
        <av:TaskDialogButtonData Value="2" Header="No, thanks" IsDefault="True" />

This doesn't work since TaskDialogButtonData doesn't have a parameterless constructor. Is there any way to do it? I don't want to add CommandLinks through csharp code because of reasons like Localization, etc. (I am using x:Uid identifiers to localize my app)

Btw thanks for the great implementation!
Dec 18, 2008 at 9:04 AM
Hi Huseyin,

I'm sorry to say it's a scenario that slipped by me. You have a few options:
  • Download the code and add a parameterless constructor to TaskDialogButtonData.
  • Create your own class and use TaskDialog.CommandLinkContainerStyle to create a new DataTemplate for it.
  • Add a CommandLink directly to the CommandLinks collection.

I'd go for the first option. Anyhow, I'll fix this in the next release.

Dec 18, 2008 at 9:05 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.