public static void ShowChoiceDialog(ChoicerContentStartArgs args) { var content = new ContentChoice(args); DialogHost.Show(content, new DialogOpenedEventHandler((s, e) => { args.CloseDialog = () => { try { e.Session.Close(); } catch (Exception ex) { SLogger.Warn(senderOrTag: "ChoiceDialog", content: "an error happend on closing choice dialog", ex: ex); } }; })); }
public VMContentChoice(ChoicerContentStartArgs args) { Model = args; DoChoice = new FlexiableCommand((para) => { switch (para) { case "R": args.DidChoice(ChoicerResult.Right); break; case "C": args.DidChoice(ChoicerResult.Center); break; default: args.DidChoice(ChoicerResult.Cancel); break; } }); }
internal ContentChoice(ChoicerContentStartArgs args) { InitializeComponent(); ViewModel = new VMContentChoice(args); }