简体   繁体   中英

Can I use Xam.Plugin.Forms.ImageCircle in platform WPF

I am a newbie so I started learn how to apply plugin name Xam.Plugin.Forms.ImageCircle in my Xamarin Project. I add platform WPF instead of UWP and after I install plugin above and I can not call ImageCircleRenderer.Init() in file App.xaml.cs. So I wonder if I can use this plugin and how to configure it in case using this plugin is possible in WPF. Thank you

Xamarin.Forms plugins consists of essentially two parts. The Xamarin.Forms element that you place of the shared page or view and a platform specific renderer, which tells the specific platforms how to draw the element using native controls and UI.

The plugin your talking about doesn't have a platform implementation for WPF, so although you can add the pacakge in you shared XF project, it won't be rendered in the WPF app.

You could port the UWP renderer to WPF as they are similar Renderer.uwp.cs , but there are big differences between the syntax and availble UI elements on UWP and WPF.

I have checked the package on wpf, it does not work.

If you want to use circle images in wpf, you could try the code below.

  <Ellipse Width="250" Height="250">
        <Ellipse.Fill>
            <ImageBrush ImageSource="http://upload.wikimedia.org/wikipedia/commons/5/55/Tamarin_portrait.JPG" />
        </Ellipse.Fill>
    </Ellipse>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM