Exemple #1
0
        protected override ImageView CreateNativeControl()
        {
            _nativeControl = new MvxDroidImageView(Context);
            _nativeControl.ImageChanged += OnSourceImageChanged;

            return(_nativeControl);
        }
Exemple #2
0
        protected override void OnElementChanged(ElementChangedEventArgs <Image> args)
        {
            if (args.OldElement != null)
            {
                if (_nativeControl != null)
                {
                    _nativeControl.ImageChanged -= OnSourceImageChanged;
                    _nativeControl.Dispose();
                    _nativeControl = null;
                }
            }

            if (Element.Source != null)
            {
                MvxTrace.Warning("Source property ignored on MvxImageView");
            }

            base.OnElementChanged(args);

            if (_nativeControl != null)
            {
                if (_nativeControl.ErrorImagePath != SharedControl.ErrorImagePath)
                {
                    _nativeControl.ErrorImagePath = SharedControl.ErrorImagePath;
                }

                if (_nativeControl.DefaultImagePath != SharedControl.DefaultImagePath)
                {
                    _nativeControl.DefaultImagePath = SharedControl.DefaultImagePath;
                }

                if (_nativeControl.ImageUrl != SharedControl.ImageUri)
                {
                    _nativeControl.ImageUrl = SharedControl.ImageUri;
                }
            }
        }