/// <summary> /// Exposes to the user a text-format selector for the supplied Initial Text-Format. /// Returns indication of success (true, false=cancelled) plus the new text-format. /// </summary> public static Tuple <bool, TextFormat> SelectFor(TextFormat InitialTextFormat) { var Selector = new TextFormatSelector(InitialTextFormat); Selector.SelectionAction = (selectedtextformat => { Selector.SelectedTextFormat = selectedtextformat; SelectionWindow.Close(); }); var Result = Display.OpenContentDialogWindow <TextFormatSelector>(ref SelectionWindow, "Text format...", Selector).IsTrue(); return(new Tuple <bool, TextFormat>(Result, Selector.SelectedTextFormat)); }