Clipboard Support
UserPromptWindow supports copying text to the clipboard when the default clipboard keyboard shortcut (e.g., Ctrl+C on Windows) is invoked.. Since UserPromptWindow also supports rich content of potentially complex control structures, it may not be possible to accurately translate the various properties to textual clipboard content.
The properties in the following table have a corresponding string-based property that can be used to explicitly define the text to be placed on the system clipboard for that object when the copy command is invoked.
Property | Clipboard Property |
---|---|
ButtonItems | ButtonItemsClipboardText |
CheckBoxContent | CheckBoxContentClipboardText |
Content |
ContentClipboardText |
ExpandedInformationContent | ExpandedInformationContentClipboardText |
Footer | FooterClipboardText |
Header |
HeaderClipboardText |
When using the builder pattern, a corresponding With*
method is available for each property (e.g., WithHeaderClipboardText or WithCheckBoxContentClipboardText).
Buttons
When ButtonItemsClipboardText is not explicitly defined, the value will be coerced from each button. Use the UserPromptControl.ButtonClipboardText
attached property to explicitly define the text to represent the button on the clipboard. When this property is undefined, the Button.Content
will be examined to determine the most appropriate text.
When using the builder pattern, the attached property can be set using the WithContentClipboardText method of the button's builder as shown in the following example:
await UserPromptBuilder.Configure()
// ... other configuration options here
.WithButton(_ => _
.WithResult(MessageBoxResult.Ignore)
.WithContentClipboardText("Continue")
)
.Show();