paulpatarinski / Xamarin.Forms.Plugins

Xamarin Forms Plugins
http://paulpatarinski.github.io/Xamarin.Forms.Plugins
MIT License
276 stars 140 forks source link

is is possible to reassign SvgPath? #84

Open EmilAlipiev opened 8 years ago

EmilAlipiev commented 8 years ago

After the page is loaded, I try to change SvgPath with a button click but it will not reload to another svg image? is it even possible?

I have just defined on xaml

   <abstractions:SvgImage x:Name="backgroundImage"  SvgAssembly="{Binding SvgAssembly}"
    SvgPath="" HeightRequest="369" WidthRequest="200" BackgroundColor="White" HorizontalOptions="Center" VerticalOptions="Center"/>

and on the code behind simply, onselection action, I try to change the image using the path but it didnt work. What should I do to more in order to replace the image dynamically?

 public myPage()
        {
            InitializeComponent();
            backgroundImage.SvgPath = "image1.svg";

        }

        void OnSelection (object sender, SelectedItemChangedEventArgs e)
        {
           backgroundImage.SvgPath = "image2.svg";

        }
ghost commented 8 years ago

Re-Assigning does not work for me either.

xinmeng1 commented 8 years ago

+1 it doesn't work for data binding too