A context object enables you to reuse the same dialog type in different panes and for different purposes.
-
Create the context object:
-
In Project view, right-click UI and select .
-
Hover-over the object, select
, and enter ConfirmationDialogContext.
-
Convert the context object into an object type:
-
In Type view, double-click User interface.
-
From Project view, drag ConfirmationDialogContext into the Type view pane.
In Project view, ConfirmationDIalogContextType (type) appears.
-
In Project view, right-click ConfirmationDialogContext and select Delete.
-
Configure the context object type:
-
In Project view, select ConfirmationDialogContextType (type).
-
In Properties, at the top, select
and select Variable.
-
Hover-over the variable, select
and enter Message.
-
Select Int32 and select LocalizedText.
Tip: If you do not see the required option, select the Show all checkbox.
-
Remove the Message variable value.
-
In Project view, right-click ConfirmationDialogContextType (type) and select .
-
Hover-over the method invocation, select
and enter OnConfirm.
-
In Project view, right-click ConfirmationDialogContextType (type) and select .
-
Hover-over the method invocation, select
and enter OnCancel.