How to use SVG on the RadPopup

1 Answer 190 Views
Popup
Hakob
Top achievements
Rank 2
Iron
Hakob asked on 01 Mar 2022, 12:49 PM
Hi, please can you help me to find a solution, when I want to use SVG files on the  RadPopup!!!
Hakob
Top achievements
Rank 2
Iron
commented on 03 Mar 2022, 09:40 AM

Hi Telerik Team.

This article helped me to finger out issues about SVG. Thank you so much.

1 Answer, 1 is accepted

Sort by
0
Accepted
Lance | Manager Technical Support
Telerik team
answered on 02 Mar 2022, 02:55 PM

Hi Hakob,

There are two parts to your questions, there are not directly related to each other.

  1. You want to know how to use an SVG with Xamarin.Forms
  2. You want to know how to show an Image in a RadPopup

Answers

To answer #1, you can read this blog post and learn how to use SvgImage => Loading SVG images in Xamarin.Forms - Bastian Noffer's Blog (bnonet.com).

Keep in mind that SkiaSharp is not a Telerik product, so any information about it will be found in other sources like the Microsoft SkiaSharp documentation and tutorial blog posts. You will find a ton of information on the topic by googling "How to show SVG in Xamarin.Forms

 

Now, onto the second part of your question, how to show an image in a RadPopup. You can put whatever you want inside a Popup's content, as long as it inherits from View.

<telerikPrimitives:RadPopup.Popup>
    <telerikPrimitives:RadPopup>
        <!-- PUT WHAT YOU WANT IN HERE -->
    </telerikPrimitives:RadPopup>
</telerikPrimitives:RadPopup.Popup>

You can learn more in the RadPopup Getting Started documentation, then for more advanced and polished examples, visit either of our demos.

Conclusion

So, now you can combine the two concepts and put the SvgImage inside the popup. If you have followed the RadPopupGetting started tutorial, you can replace the popup's content with the SvgImage

<Button HorizontalOptions="Center" 
        VerticalOptions="Start" 
        Text="Click here to rate" 
        Clicked="ShowPopup">
    <telerikPrimitives:RadPopup.Popup>
        <telerikPrimitives:RadPopup x:Name="popup" IsModal="True" OutsideBackgroundColor="#6F000000">
            <svg:SvgImage Source="tiger.svg" WidthRequest="100" HeightRequest="100" />
        </telerikPrimitives:RadPopup>
    </telerikPrimitives:RadPopup.Popup>
</Button>

Further Assistance

If you need help with SkiaSharp or Svg Image component, you can open a post in either of these resources:

If you need help with the RadPopup's features, or any other Telerik UI for Xamarin component, you can open a new forum post or Support Ticket. We will be able to assist with the Telerik-specific questions.

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Hakob
Top achievements
Rank 2
Iron
commented on 09 Jun 2022, 07:22 PM

Thank you, this article helped me to finger out my issue.
Tags
Popup
Asked by
Hakob
Top achievements
Rank 2
Iron
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or