Information
Dim result As TaskDialogResult = taskDialog.Show()
If result.StandardButtonClicked = TaskDialogStandardButton.Yes Then
...
End If
The TaskDialogResult object wraps the information that the user supplied, including any
check box or radio button selections (using the CheckBoxChecked and RadioButtonClicked
properties). In this example the user has two options (Yes or No), and the clicked button is
indicated by the StandardButtonClicked property.
An alternative approach is to define the TaskDialog declaratively in XAML. Because the
TaskDialog isn??™t a WPF element, you need to declare it in the Window.Resources section of
your markup, as shown here:
xmlns:v="clr-namespace:Microsoft.SDK.Samples.VistaBridge.Library;assembly=
VistaBridgeLibrary" >
Content="Please wait while we update your account."
Instruction="Working ..." Caption ="Updating Account"
Cancelable="True" StandardButtons="Cancel">
...
You can then retrieve this object by key name in your code and use it:
Dim dialog As TaskDialog = CType(Me.Resources("simpleWait"), TaskDialog)
Dim result As TaskDialogResult = dialog.Show()
Chapter 11 covers the WPF resource system in detail.
Pages:
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461