none
Brainlock on XAML "Dialog Box" Capability

    Question

  • I'm experimenting with C++, Metro, and XAML and having difficulty figuring out how to create something like a "dialog box" in XAML for settings in my app. In Win32 (no XAML, WPF, etc.) I simply create dialog boxes with controls and show them as needed. They're created and appear independently of the main window UI. Can you create standalone dialog boxes like that in XAML or do they have to be included in the main XAML file with their visibility turned off?

    My app is a fairly complex C++ and Direct3D11 Metro app using SwapChainBackgroundPanel. Users need to be able to:

    1. Select one from a list of ~50 pre-defined graphical products that are available. Only the name of the products need to be displayed, not any associated imagery. I handle this in Win32 with a couple of long menus. A scrollable listbox in XAML would work but it would be tedious for users on smaller devices. These items can be logically broken up into groups so something like a semantic zoom control might be useful.

    2. Select one from a list of ~200 pre-defined geographic locations across the US. There are several in each state. Seems like a Semantic Zoom control would work well for this. The States would be the groups with the locations listed under each. That would allow users to quickly navigate to their choice. Do I have to create the data structure for it in C++ or can I do the whole thing in the XAML file?

    Those are absolutely required UI elements and need to be fast/easy to use. The dialog box functionality comes in when users want to customize graphical elements in the main Direct3D display.

    Thanks

    Thursday, July 19, 2012 7:45 PM

Answers

  • 1) There is no canned dialog box control. You can create your dialogs as UserControls and load them in to a Popup as needed. Since you are talking about settings, these should be made available via the settings charm. Take a look at Tim Heuer's Callisto project for an example of how to create a settings pane.

    2) You could hard-code this into the Xaml, but you are probably better off loading the data structure at runtime and binding it to the data.

    --Rob

    Thursday, July 19, 2012 10:16 PM
    Owner

All replies

  • 1) There is no canned dialog box control. You can create your dialogs as UserControls and load them in to a Popup as needed. Since you are talking about settings, these should be made available via the settings charm. Take a look at Tim Heuer's Callisto project for an example of how to create a settings pane.

    2) You could hard-code this into the Xaml, but you are probably better off loading the data structure at runtime and binding it to the data.

    --Rob

    Thursday, July 19, 2012 10:16 PM
    Owner
  • Well, this old dog is having a hard time learning new tricks. The Metro API makes the hard things simple (complex data binding) while simultaneously making the simple things hard. I'm not sure what happened in Redmond since I was there ... but you have a big, nasty dog chomping at your behind right now (the one we crushed in the early 90s) and need to make the UI simple for programmers to use. Let us generate the complex and unique content that draws users to Windows.

    Anyway, enough ranting, I'll have to bite the bullet and go through the whole CollectionViewSource crap.

    Friday, July 20, 2012 4:56 AM
  • I found that it is very easy to fill a grouped GridView with Platform::Vector of groups+items. The Metro C++ sample I was using as a reference had all sorts of extraneous interfaces and members tacked onto their Item class (propbags, etc.). Unfortunately, after all this work I discovered that I do NOT like my design! I needed to learn how to use GridViews so it's not a total loss.

    Sunday, July 22, 2012 3:36 PM