Beispiel #1
0
        private void Initialize()
        {
            Root = new RootElement("Events")
            {
                new Section("Normal Events")
                {
                    new Element("Log Single Event").Bind(this, "SelectedCommand LogNormalEventCommand"),
                    new Element("Log Parametrized Event").Bind(this, "SelectedCommand LogParametrizedEventCommand"),
                },
                new Section("Timed Events")
                {
                    new Element("Log Single Event").Bind(this, "SelectedCommand LogNormalTimedEventCommand"),
                    new Element("Log Parametrized Timed Event").Bind(this, "SelectedCommand LogParametrizedTimedEventCommand"),
                    new Element("Log Updated Parametrized Timed Event").Bind(this,
                                                                             "SelectedCommand LogParametrizedTimedEventWithEndParametersCommand"),
                },
                new Section("Errors")
                {
                    new Element("Log Error").Bind(this, "SelectedCommand LogErrorCommand")
                },
            };

            // show a progress box if there is some work
            var events = ViewModel as EventsViewModel;

            if (events != null)
            {
                UIAlertView progress = null;
                events.PropertyChanged += (sender, e) =>
                {
                    if (e.PropertyName == "IsWorking")
                    {
                        if (events.IsWorking)
                        {
                            if (progress == null)
                            {
                                progress = new UIAlertView("Working...", "Doing absolutely nothing in the background...", null, null, null);
                                UIActivityIndicatorView indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
                                indicator.StartAnimating();
                                progress.SetValueForKey(indicator, (NSString)"accessoryView");
                                progress.Show();
                            }
                        }
                        else
                        {
                            if (progress != null)
                            {
                                progress.DismissWithClickedButtonIndex(0, true);
                                progress = null;
                            }
                        }
                    }
                };
            }
        }
		private void Initialize()
		{
			Root = new RootElement("Events")
			{
				new Section("Normal Events")
				{
					new Element("Log Single Event").Bind(this, "SelectedCommand LogNormalEventCommand"),
					new Element("Log Parametrized Event").Bind(this, "SelectedCommand LogParametrizedEventCommand"),
				},
				new Section("Timed Events")
				{
					new Element("Log Single Event").Bind(this, "SelectedCommand LogNormalTimedEventCommand"),
					new Element("Log Parametrized Timed Event").Bind(this, "SelectedCommand LogParametrizedTimedEventCommand"),
					new Element("Log Updated Parametrized Timed Event").Bind(this,
						"SelectedCommand LogParametrizedTimedEventWithEndParametersCommand"),
				},
				new Section("Errors")
				{
					new Element("Log Error").Bind(this, "SelectedCommand LogErrorCommand")
				},
			};

			// show a progress box if there is some work
			var events = ViewModel as EventsViewModel;
			if (events != null)
			{
				UIAlertView progress = null;
				events.PropertyChanged += (sender, e) =>
				{
					if (e.PropertyName == "IsWorking")
					{
						if (events.IsWorking)
						{
							if (progress == null)
							{
								progress = new UIAlertView("Working...", "Doing absolutely nothing in the background...", null, null, null);
								UIActivityIndicatorView indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
								indicator.StartAnimating();
								progress.SetValueForKey(indicator, (NSString)"accessoryView");
								progress.Show();
							}
						}
						else
						{
							if (progress != null)
							{
								progress.DismissWithClickedButtonIndex(0, true);
								progress = null;
							}
						}
					}
				};
			}
		}
Beispiel #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();
        }
Beispiel #4
0
 public void ShowImage(UIImage image)
 {
     EnsureInvokedOnMainThread(() =>
     {
         UIImageView uiIV = new UIImageView(image);
         UIAlertView Msg  = new UIAlertView
         {
             Frame = new CoreGraphics.CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height)
         };
         Msg.SetValueForKey(uiIV, (NSString)"accessoryView");
         Msg.AddButton("X");
         Msg.Show();
     });
 }
Beispiel #5
0
        public static void Show(String title, String message, bool showCancel = true)
        {
            if (alert == null || (alert != null && showCancel == true))
            {
                if (showCancel)
                {
                    alert = new UIAlertView(title, message, null, StringRef.cancel, null);
                }
                else
                {
                    alert = new UIAlertView(title, message, null, null, null);
                }
                alert.Dismissed += HandleDismissed;

                UIView customView = new UIView();
                customView.BackgroundColor = UIColor.Clear;
                customView.Frame           = new CGRect(0, 0, 270, 48);

                try
                {
                    RTSpinKitView spinner = eBriefingAppearance.GenerateBounceSpinner();
                    spinner.Frame = new CGRect(customView.Center.X - (spinner.Frame.Width / 2), 0, spinner.Frame.Width, spinner.Frame.Height);
                    customView.AddSubview(spinner);
                }
                catch (Exception ex)
                {
                    Logger.WriteLineDebugging("LoadingView - Show: {0}", ex.ToString());
                }

                alert.SetValueForKey(customView, new NSString("accessoryView"));
                alert.Show();
            }
            else
            {
                alert.Title   = title;
                alert.Message = message;
            }
        }