コード例 #1
0
        private static void ShowOneButtonAlert(UIViewController scope, string type, string message)
        {
            var okAlertController = UIAlertController.Create(type, message, UIAlertControllerStyle.Alert);

            okAlertController.AddAction(UIAlertAction.Create(IosLocalizator.Translate(Constants.BUTTON_OK), UIAlertActionStyle.Default, null));
            scope.PresentViewController(okAlertController, true, null);
        }
コード例 #2
0
        public static void ShowOkCancelAlert(this UIViewController scope, string type, string message, Action okHandler)
        {
            var okCancelAlertController = UIAlertController.Create(type, message, UIAlertControllerStyle.Alert);

            //Add Actions
            okCancelAlertController.AddAction(UIAlertAction.Create(IosLocalizator.Translate(Constants.BUTTON_OK), UIAlertActionStyle.Default, alert => scope.Invoke(okHandler, 0)));
            okCancelAlertController.AddAction(UIAlertAction.Create(IosLocalizator.Translate(Constants.BUTTON_CANCEL), UIAlertActionStyle.Cancel, null));

            //Present Alert
            scope.PresentViewController(okCancelAlertController, true, null);
        }
コード例 #3
0
        public static void ShowImageAlert(this UIViewController scope, string title, UIImage image, string message)
        {
            var alert = new UIAlertView()
            {
                Title   = title,
                Message = message
            };

            alert.SetValueForKey(new UIImageView(image), (NSString)"accessoryView");
            alert.AddButton(IosLocalizator.Translate(Constants.BUTTON_OK));
            alert.Show();
        }
コード例 #4
0
 public static void ShowError(this UIViewController scope, string message)
 {
     ShowOneButtonAlert(scope, IosLocalizator.Translate(Constants.TITLE_ERROR), message);
 }
コード例 #5
0
 public static void ShowWarning(this UIViewController scope, string message)
 {
     ShowOneButtonAlert(scope, IosLocalizator.Translate(Constants.TITLE_DELETE), message);
 }