1

I have MessageDialog code like this:

MessageDialog dlg = new MessageDialog("None of the images you selected contain location information. You can add your own after downloading http://exifpilot.com/");
await dlg.ShowAsync();

Rather than just have it display like that (with raw/boring text), I want to make the link clickable. Is it possible to embed a HyperlinkButton into the MessageDialog as one of its buttons, or better yet, make the appropriate portion of the text clickable/tappable? Can XAML or HTML be used as the text value to accomplish this, or is nigh on to impossible?

UPDATE

I have installed Version 1.4.0.0 of Callisto and it is , but with this XAML:

<Page
    . . .
    xmlns:Controls="using:Callisto.Controls"
    mc:Ignorable="d">

    <callisto:CustomDialog x:FieldModifier="public" x:Name="GetPhotosetName" 
                       Title="Photoset Name" 
                       Background="Teal" BackButtonVisibility="Visible">
        <StackPanel>
            <TextBlock Margin="0,0,0,8" FontSize="14.6667" FontWeight="SemiLight" TextWrapping="Wrap">
            Enter a name for the photoset you are creating
            </TextBlock>
            <TextBlock Margin="0,0,0,8" FontSize="14.6667" FontWeight="SemiLight" Text="Enter your name for acceptance" />
            <callisto:WatermarkTextBox HorizontalAlignment="Left" Watermark="Enter the photoset name" Width="400" Height="35" />
            <StackPanel Margin="0,20,0,0" HorizontalAlignment="Right" Orientation="Horizontal">
                <Button Content="OK" Width="90" Margin="0,0,20,0" />
                <Button Content="CANCEL" Width="90" Click="DialogCancelClicked" />
            </StackPanel>
        </StackPanel>
    </callisto:CustomDialog>

...I get several err msgs, such as "The type 'callisto:CustomDialog' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built." and "The namespace prefix "callisto" is not defined." and "CustomDialog is not supported in a Windows App project."

UPDATE 2

Note: I changed the XAML a smidgen, from:

callisto:WatermarkTextBox x:Name="txtbxPhotosetName" HorizontalAlignment="Left" Watermark="Enter the photoset name" Width="400" Height="35" />

...to:

<TextBox x:Name="txtbxPhotosetName" HorizontalAlignment="Left" PlaceholderText="Enter the photoset name" Width="400" Height="35" />

...because of a warning advising me that the watermark functionality is now available natively for TextBoxes via the PlaceholderText property.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

1 Answers1

2

No. The MessageDialog is not customisable, but you can create your own control which mimics the look and feel of the MessageDialog (plus your custom enhancements).

There are several turnkey custom dialogs available (such as in http://callistotoolkit.com/ ) or you can cobble a one-shot pretty easily. A minimum version could be a popup containing a three row Grid with a partially transparent background and the TextBlock with Hyperlink in the centre row.

Also consider if a MessageDialog is the right way to surface the error rather than showing the error message inline. See Guidelines for Message dialogs and Choosing the right UI surfaces: Errors.

--Rob

Rob Caplan - MSFT
  • 21,714
  • 3
  • 32
  • 54
  • Thanks a heap! The Callisto Custom Dialog looks like JWtDO (altho I'm not a doctor, I have been PhD (Post hole Digger)). – B. Clay Shannon-B. Crow Raven Oct 23 '14 at 04:23
  • You're defining "controls" in your xmlns statement then using "callisto" as the namespace when you define the ContentDialog – Rob Caplan - MSFT Oct 23 '14 at 17:59
  • If I understand that correctly, then I could either remove the "xmlns:Controls="using:Callisto.Controls"" entirely, OR change "callisto:" to "Controls" Am I right? – B. Clay Shannon-B. Crow Raven Oct 23 '14 at 18:41
  • 1
    The second: You need it, but the two sides need to match. If you declare it as "controls" then you need to reference it as "controls". If you want to reference it as "Callisto" then you need to declare it as "Callisto" – Rob Caplan - MSFT Oct 23 '14 at 19:44
  • Beware of "pretty easy" when it comes to emulating standard UI, things that come to mind are high-DPI, resolution changes, accessibility, input methods, it can be quite hard to make a complex custom UI like a dialog with rich content that truly behaves correctly. – Axel Rietschin Jun 21 '17 at 07:31