public static UIVisualEffectView Create (CGRect frame, UIBlurEffectStyle style)
		{
			var blurEffect = UIBlurEffect.FromStyle (style);
			var blurView = new UIVisualEffectView (blurEffect) {
				Frame = frame
			};

			return blurView;
		}
        public void UpdateStyle(UIBlurEffectStyle style)
        {
            blurView?.RemoveFromSuperview();
            var blur = UIBlurEffect.FromStyle(style);

            blurView = new UIVisualEffectView(blur);

            Add(blurView);
        }
		public static UIVisualEffectView Vibrant (CGRect frame, UIBlurEffectStyle style)
		{
			var blurEffect = UIBlurEffect.FromStyle (style);
			var vibrancyEffect = UIVibrancyEffect.FromBlurEffect (blurEffect);
			var vibrancyView = new UIVisualEffectView (vibrancyEffect) {
				Frame = frame
			};

			return vibrancyView;
		}
        public static UIVisualEffectView Create(CGRect frame, UIBlurEffectStyle style)
        {
            var blurEffect = UIBlurEffect.FromStyle(style);
            var blurView   = new UIVisualEffectView(blurEffect)
            {
                Frame = frame
            };

            return(blurView);
        }
        public static UIVisualEffectView Vibrant(CGRect frame, UIBlurEffectStyle style)
        {
            var blurEffect     = UIBlurEffect.FromStyle(style);
            var vibrancyEffect = UIVibrancyEffect.FromBlurEffect(blurEffect);
            var vibrancyView   = new UIVisualEffectView(vibrancyEffect)
            {
                Frame = frame
            };

            return(vibrancyView);
        }
Exemple #6
0
 public void UpdateStyle(UIBlurEffectStyle style)
 {
     blurView?.RemoveFromSuperview();
     if (Device.IsIos8)
     {
         var blur = UIBlurEffect.FromStyle(style);
         blurView = new UIVisualEffectView(blur);
     }
     else
     {
         blurView = new UIToolbar
         {
             Opaque      = true,
             Translucent = true,
             BarStyle    = UIBarStyle.BlackTranslucent,
         };
     }
     Add(blurView);
 }
Exemple #7
0
        /// <summary>
        /// Applies the blurr with efftect style.
        /// </summary>
        /// <returns>The blurr with efftect style.</returns>
        /// <param name="style">Style.</param>
        /// <param name="frame">Frame.</param>
        public static UIVisualEffectView ApplyBlurrWithEfftectStyle(UIBlurEffectStyle style, CGRect frame)
        {
            //only apply the blur if the user hasn't disabled transparency effects
            if (!UIAccessibility.IsReduceTransparencyEnabled)
            {
                var blurEffect = UIBlurEffect.FromStyle(style);

                var blurEffectView = new UIVisualEffectView(blurEffect);
                blurEffectView.Alpha            = 0.6f;
                blurEffectView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
                blurEffectView.Frame            = frame;

                return(blurEffectView);
            }
            else
            {
                // ios 7 implementation
            }

            return(null);
        }
Exemple #8
0
 public BluredView(UIBlurEffectStyle style)
 {
     UpdateStyle(style);
 }
		public static void AddBlur (this UIImageView imageView, UIBlurEffectStyle style)
		{
			var blurView = Blur.Create (imageView.Frame, style);

			imageView.AddSubview (blurView);
		}
		/// <summary>
		/// Shows the dialog.
		/// </summary>
		/// <returns>The dialog.</returns>
		/// <param name="title">Title.</param>
		/// <param name="message">Message.</param>
		/// <param name="selectedDate">Selected date.</param>
		/// <param name="effectStyle">Effect style.</param>
		public static Task<DateTime?> ShowDialogAsync(UIDatePickerMode mode, String title, String message, DateTime? selectedDate = null, UIBlurEffectStyle effectStyle = UIBlurEffectStyle.ExtraLight)
		{
			var tcs = new TaskCompletionSource<DateTime?> ();


			new NSObject ().BeginInvokeOnMainThread (() => {

				var dialog = new XamDatePickerDialog(mode)
				{
					Title = title,
					Message = message,
					BlurEffectStyle = effectStyle,
					ConstantUpdates = false,
				};

				if (selectedDate.HasValue)
					dialog.SelectedDate = selectedDate.Value;

				dialog.OnCancel += (object sender, EventArgs e) => 
				{
					tcs.SetResult(null);
				};

				dialog.OnSelectedDateChanged += (object s, DateTime e) => 
				{
					tcs.SetResult(dialog.SelectedDate);
				};

				dialog.Show();

			});

			return tcs.Task;
		}
        /// <summary>
        /// Shows the dialog on a specific view
        /// </summary>
        /// <returns>The dialog async.</returns>
        /// <param name="view">The view</param>
        /// <param name="mode">Mode.</param>
        /// <param name="title">Title.</param>
        /// <param name="message">Message.</param>
        /// <param name="selectedDate">Selected date.</param>
        /// <param name="effectStyle">Effect style.</param>
        public static Task <DateTime?> ShowDialogAsync(UIView view, UIDatePickerMode mode, String title, String message, DateTime?selectedDate = null, UIBlurEffectStyle effectStyle = UIBlurEffectStyle.ExtraLight)
        {
            var tcs = new TaskCompletionSource <DateTime?> ();


            new NSObject().BeginInvokeOnMainThread(() => {
                var dialog = new XamDatePickerDialog(mode)
                {
                    Title           = title,
                    Message         = message,
                    BlurEffectStyle = effectStyle,
                    ConstantUpdates = false,
                };

                if (selectedDate.HasValue)
                {
                    dialog.SelectedDate = selectedDate.Value;
                }

                dialog.OnCancel += (object sender, EventArgs e) =>
                {
                    tcs.SetResult(null);
                };

                dialog.OnSelectedDateChanged += (object s, DateTime e) =>
                {
                    tcs.SetResult(dialog.SelectedDate);
                };

                dialog.Show(view);
            });

            return(tcs.Task);
        }
		/// <summary>
		/// Shows the dialog on the specified view controller
		/// </summary>
		/// <returns>The dialog async.</returns>
		/// <param name="view">View.</param>
		/// <param name="title">Title.</param>
		/// <param name="message">Message.</param>
		/// <param name="items">Items.</param>
		/// <param name="selectedItem">Selected item.</param>
		/// <param name="effectStyle">Effect style.</param>
		public static Task<String> ShowDialogAsync(UIView view, String title, String message, List<String> items, String selectedItem = null, UIBlurEffectStyle effectStyle = UIBlurEffectStyle.ExtraLight)
		{
			var tcs = new TaskCompletionSource<String> ();


			new NSObject ().BeginInvokeOnMainThread (() => {

				var dialog = new XamSimplePickerDialog(items)
				{
					Title = title,
					Message = message,
					BlurEffectStyle = effectStyle,
					ConstantUpdates = false,
				};

				if (!String.IsNullOrWhiteSpace(selectedItem))
					dialog.SelectedItem = selectedItem;

				dialog.OnCancel += (object sender, EventArgs e) => 
				{
					tcs.SetResult(null);
				};

				dialog.OnSelectedItemChanged += (object s, string e) => 
				{
					tcs.SetResult(dialog.SelectedItem);
				};

				dialog.Show(view);

			});

			return tcs.Task;
		}
Exemple #13
0
        /// <summary>
        /// Shows the dialog on the specified View Controller
        /// </summary>
        /// <returns>The dialog async.</returns>
        /// <param name="vc">The view controlller</param>
        /// <param name="title">Title.</param>
        /// <param name="message">Message.</param>
        /// <param name="items">Items.</param>
        /// <param name="selectedItem">Selected item.</param>
        /// <param name="effectStyle">Effect style.</param>
        public static Task <String> ShowDialogAsync(UIViewController vc, String title, String message, List <String> items, String selectedItem = null, UIBlurEffectStyle effectStyle = UIBlurEffectStyle.ExtraLight)
        {
            var tcs = new TaskCompletionSource <String> ();


            new NSObject().BeginInvokeOnMainThread(() => {
                var dialog = new XamSimplePickerDialog(items)
                {
                    Title           = title,
                    Message         = message,
                    BlurEffectStyle = effectStyle,
                    ConstantUpdates = false,
                };

                if (!String.IsNullOrWhiteSpace(selectedItem))
                {
                    dialog.SelectedItem = selectedItem;
                }

                dialog.OnCancel += (object sender, EventArgs e) =>
                {
                    tcs.SetResult(null);
                };

                dialog.OnSelectedItemChanged += (object s, string e) =>
                {
                    tcs.SetResult(dialog.SelectedItem);
                };

                dialog.Show(vc);
            });

            return(tcs.Task);
        }
        public static void AddBlur(this UIImageView imageView, UIBlurEffectStyle style)
        {
            var blurView = Blur.Create(imageView.Frame, style);

            imageView.AddSubview(blurView);
        }
Exemple #15
0
 public UIBlurEffect(UIBlurEffectStyle style)
 {
 }
        /// <summary>
        /// Shows the dialog on the specified view controller
        /// </summary>
        /// <returns>The dialog async.</returns>
        /// <param name="view">View.</param>
        /// <param name="title">Title.</param>
        /// <param name="message">Message.</param>
        /// <param name="items">Items.</param>
        /// <param name="selectedItem">Selected item.</param>
        /// <param name="effectStyle">Effect style.</param>
        public static Task <uint?> ShowDialogAsync(UIView view, String title, String message, List <String> items, uint selectedIndex = 0, UIBlurEffectStyle effectStyle = UIBlurEffectStyle.ExtraLight)
        {
            var tcs = new TaskCompletionSource <uint?> ();


            new NSObject().BeginInvokeOnMainThread(() => {
                var dialog = new XamSimplePickerDialog(items)
                {
                    Title           = title,
                    Message         = message,
                    ConstantUpdates = false,
                };

                dialog.SelectedIndex = selectedIndex;

                dialog.OnCancel += (object sender, EventArgs e) =>
                {
                    tcs.SetResult(null);
                };

                dialog.OnSelectedIndexChanged += (object s, uint e) =>
                {
                    tcs.SetResult(dialog.SelectedIndex);
                };

                dialog.Show(view);
            });

            return(tcs.Task);
        }