private void HandleColorSelectorButtonTap(object sender, EventArgs e)
        {
            InfColorPickerController colorPicker = InfColorPickerController.ColorPickerViewController();

            colorPicker.Delegate = new ColorSelectedDelegate(this);
            colorPicker.PresentModallyOverViewController(this);
        }
        private void HandleTouchUpInsideWithStrongDelegate(object sender, EventArgs e)
        {
            InfColorPickerController picker = InfColorPickerController.ColorPickerViewController;

            picker.Delegate = selector;
            picker.PresentModallyOverViewController(this);
        }
        private void HandleTouchUpInsideWithWeakDelegate(object sender, EventArgs e)
        {
            InfColorPickerController picker = InfColorPickerController.ColorPickerViewController();

            picker.WeakDelegate = this;
            picker.SourceColor  = this.View.BackgroundColor;
            picker.PresentModallyOverViewController(this);
        }
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            xamarinView                 = e.NewElement as PickerColorSelectorView;
            picker                      = InfColorPickerController.ColorPickerViewController;
            picker.View.Frame           = new CGRect(0, 50, View.Frame.Width, NativeView.Frame.Height - 50);
            xamarinView.BackgroundColor = picker.View.BackgroundColor.ToColor();
            NativeView.Add(picker.View);
        }
Example #5
0
        public void Show()
        {
            UIWindow window = UIApplication.SharedApplication.KeyWindow;

            if (window == null)
            {
                throw new InvalidOperationException("There's no current active window");
            }

            var viewController = window.RootViewController;

            ColorSelectedDelegate selector = new ColorSelectedDelegate(viewController);

            InfColorPickerController picker = InfColorPickerController.ColorPickerViewController;

            picker.Delegate = selector;
            picker.PresentModallyOverViewController(viewController);
        }
Example #6
0
        public override void ColorPickerControllerDidFinish(InfColorPickerController controller)
        {
            nfloat red   = 0;
            nfloat green = 0;
            nfloat blue  = 0;
            nfloat alpha = 1;

            if (controller.ResultColor != null)
            {
                controller.ResultColor.GetRGBA(out red, out green, out blue, out alpha);
            }

            Color color = new Color(red, green, blue, alpha);

            parent.DismissViewController(false, () =>
            {
                MessagingCenter.Send <App, Color>(((App)App.Current), Messages.COLOR_PICKED, color);
            });
        }
 public override void ColorPickerControllerDidFinish(InfColorPickerController controller)
 {
     parent.View.BackgroundColor = controller.ResultColor;
     parent.DismissViewController (false, null);
 }
Example #8
0
 public override void ColorPickerControllerDidFinish(InfColorPickerController controller)
 {
     parent.View.BackgroundColor = controller.ResultColor;
     //parent.DismissViewController(false, null);
 }
 public void ColorPickerControllerDidFinish(InfColorPickerController controller)
 {
     View.BackgroundColor = controller.ResultColor;
     DismissViewController(false, null);
 }
		public void ColorPickerControllerDidFinish (InfColorPickerController controller)
		{
			View.BackgroundColor = controller.ResultColor;
			DismissViewController (false, null);
		}