async void UpdateSource()
        {
            ImageSource source = Element.Source;

            ((IImageController)Element).SetIsLoading(true);

            if (Control != null)
            {
                bool success = await Control.LoadFromImageSourceAsync(source);

                if (!IsDisposed && success)
                {
                    ((IVisualElementController)Element).NativeSizeChanged();
                    _circleImage.Show();
                    _circleImage.Geometry = Control.Geometry;
                    Control.SetClip(_circleImage);

                    UpdateAfterLoading();
                }
            }

            if (!IsDisposed)
            {
                ((IImageController)Element).SetIsLoading(false);
            }
        }
示例#2
0
 protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     base.OnElementPropertyChanged(sender, e);
     _circleImage          = new ElmSharp.EvasImage(Forms.NativeParent);
     _circleImage.IsFilled = true;
     _circleImage.File     = ResourcePath.GetPath("circle.png");
     _circleImage.Show();
     _circleImage.Geometry = Control.Geometry;
     Control.SetClip(_circleImage);
     Control.LayoutUpdated += OnLayoutUpdated;
     Control.Moved         += Control_Moved;
     Control.Deleted       += Control_Deleted;
 }
示例#3
0
 protected override void OnElementChanged(ElementChangedEventArgs <Layout> e)
 {
     base.OnElementChanged(e);
     if (_circleImage == null)
     {
         _circleImage          = new ElmSharp.EvasImage(Forms.NativeParent);
         _circleImage.IsFilled = true;
         _circleImage.File     = ResourcePath.GetPath("circle.png");
         _circleImage.Show();
         _circleImage.Geometry   = Control.Geometry;
         _circleImage.PassEvents = true;
         Control.SetClip(_circleImage);
         Control.LayoutUpdated += OnLayoutUpdated;
         Control.Moved         += Control_Moved;
         Control.Deleted       += Control_Deleted;
     }
 }