Beispiel #1
0
        private void SetupButtons(ContentDialog dialog)
        {
            switch (Type)
            {
            case MessageBoxType.Ok:
                dialog.SetPrimaryButton(Resolver.Resolve(ResourceTypes.Ok));
                break;

            case MessageBoxType.OkCancel:
                dialog.SetPrimaryButton(Resolver.Resolve(ResourceTypes.Ok));
                dialog.SetSecondaryButton(Resolver.Resolve(ResourceTypes.Cancel));
                break;

            case MessageBoxType.YesNo:
                dialog.SetPrimaryButton(Resolver.Resolve(ResourceTypes.Yes));
                dialog.SetSecondaryButton(Resolver.Resolve(ResourceTypes.No));
                break;

            case MessageBoxType.YesNoCancel:
                dialog.SetPrimaryButton(Resolver.Resolve(ResourceTypes.Yes));
                dialog.SetSecondaryButton(Resolver.Resolve(ResourceTypes.No));
                dialog.SetCloseButton(Resolver.Resolve(ResourceTypes.Cancel));
                break;

            default:
                break;
            }
        }
Beispiel #2
0
 public static ContentDialog SetSecondaryButton(this ContentDialog dialog, string text,
                                                TypedEventHandler <ContentDialog, ContentDialogButtonClickEventArgs> clickHandler)
 {
     dialog.SetSecondaryButton(text);
     dialog.SecondaryButtonClick += clickHandler;
     return(dialog);
 }