Esempio n. 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;
            }
        }
Esempio n. 2
0
 public static ContentDialog SetPrimaryButton(this ContentDialog dialog, string text,
                                              TypedEventHandler <ContentDialog, ContentDialogButtonClickEventArgs> clickHandler)
 {
     dialog.SetPrimaryButton(text);
     dialog.PrimaryButtonClick += clickHandler;
     return(dialog);
 }
 public static ContentDialog SetPrimaryButton(this ContentDialog cd, string text,
                                              TypedEventHandler <ContentDialog, ContentDialogButtonClickEventArgs> clickHandler)
 {
     cd.SetPrimaryButton(text);
     cd.PrimaryButtonClick += clickHandler;
     return(cd);
 }