Display svg in Metro App with c# and xaml - c#

I'm working at a Windows 8 Metro Application with XAML and C#
I have got a Uri to a SVG Image, which really works, but I have no Idea how to get this Image and display it in the XAML.
Or is it impossible to work with SVG în .NET Core?

One way could be to convert the SVG to XAML paths - which you can display in any XAML view/control. I use this approach to show vector icons in my app. Do a quick search for SVG to(http://benpittoors.wordpress.com/2009/03/17/convert-svg-to-xaml/)

Or is it impossible to work with SVG în .NET Core?
The .NET Metro Profile is NOT the .NET 4.5 Full Profile or even the .NET Client Profile. One of the requirements or limitations of the Metro application is the inability to link to any content not compiled with Metro Profile.
I suggest you use WPF instead.

Related

Is there any PDF Viewer in .NET MAUI App?

I am using .NET MAUI app for migrating my xamarin.forms into .NET MAUI. I have problem which i have to view pdf file in .NET MAUI app or in .NET MAUI Page as i previously did in Xamarin.Forms. I was using SfPdfViewer in Xamarin.Forms and it was working fine.
Kindly Help or guide please.
I want to View Pdf file in .Net Maui page in mobile app.
No, but hear me out. Search for PDF rendering instead.
Those viewers are doing a lot of useless work. In most cases you will want to simply scroll over the content of your PDF.
The way I achieve this is by rendering the PDF to images. And then using container to display them. You can set the DPI when rendering, so you don't make them too big (if you are using phone for example). You can implement some background loading, etc.
The end result is that you have something running at light speed.
As per their site, it looks like they don't have PDFViewer in MAUI. However, you should be able to integrate Blazor PDF Viewer into the MAUI app. Check out this documentation. I hope this helps.
https://blazor.syncfusion.com/documentation/getting-started/maui-blazor-app
#Muhammed Ali,
Greetings from Syncfusion!!
We have added PDF Viewer control in .NET MAUI to view PDF files in our latest Essential Studio 2022 Volume 4 Main Release V20.4.0.38. In this first release, we have provided support for displaying PDF files with page navigation and magnification functionalities. We will be adding more features to the control in our upcoming releases on a priority basis.
Please check our user guide and try this new PDF Viewer control in your application.
https://help.syncfusion.com/maui/pdf-viewer/overview

How can I use Rive animations in a WPF / XAML project?

I have a *.rive file and I want to use that in my WPF app like a loading spinner.
There is any way to use rive file in WPF using Image, Media Element etc.
Do I need to convert it as gif?
Short answer: You cannot
Rive is not just an animation tool, but an animation framework that requires a specially written runtime for different kinds of hosts.
Rive's documentation says they only have first-party support for:
The web (and a first-party React wrapper).
iOS, Android, Flutter, Tizen
React Native
"C++"
Note the lack of WPF, XAML, WinUI, UWP, Jupiter, Silverlight, WinForms, etc.
Microsoft's desktop developer story in 2021 sure is fun, isn't it?
MS hasn't had a clear and consistent desktop story since Windows 7, it's depressing, and still awful.
I note that "C++" isn't a platform, just a language, so it's odd that they describe it like that. Anyway, their C++ runtime ships with a renderer for Skia, which isn't of much use
Long answer: You can, if you want to put the effort in
Clone and build their C++ runtime.
Replace the Skia renderer with a new renderer of your own creation that renders to WPF somehow.
You can host Skia within WPF, but it's an opaque surface: the structure and contents of the Rive animation wouldn't be rendered directly by WPF which would introduce inefficiencies.
Also, I think WPF is still stuck on DirectX 9, and there might be functionality in Rive that would benefit from being on DX12.
And the rest is an exercise for the reader.
I haven't tested it but
here is a runtime for rive in C# + UWP
https://github.com/rive-app/rive-sharp
here is a way how to display UWP in WPF
In WPF control - display a UWP app

WebView.NavigateToLocalStreamUri() method example for WPF WebView

I could not find an example of WebView.NavigateToLocalStreamUri(Uri, IUriToStreamResolver) Method for WPF WebView.
All the examples, such as this and this, I've seen so far are for UWP Webview
Question: Can someone please either give or point to an example for WPF Webview where it shows how to load local web content (e.g. local html file) at the specified Uniform Resource Identifier (URI) using an IUriToStreamResolver?
Remark: I'm using latest versions of VS2019, .NET Core on Windows 10 Pro

Animated Icons in Windows Phone SDK

I am working on a weather app (for learning purposes) using Windows Phone SDK and C# as programming language.
I need to display an icon for each type of weather, for example, cloudy, raining, sunny, windy etc. I was wondering about what my options are.
I googled a little and found this. This is a Javascript library. Is there any way I can use this in my xaml page? If not, what are my options to show animated images in xaml?
No, you cannot use javascript based images in XAML.
You have several options here:
Use gif images (supported via third party components)
Use small videos (MediaElement)
Animate it yourself using XAML elements (hardest)
Use WebBrowser component and then import that js images (might also be hard)

Silverlight XAML to Windows Mobile 6.1/6.5 forms?

Is it possible or practical to have a system in a Windows Mobile 6.1/6.5 app which takes in a silverlight XAML file and creates a representation of said XAML file with form controls?
So I guess my questions are as follows:
1) Is it practical to do?
2) How can it be done (are there any good XML parses that could be used?)
Thanks for any help!
I don't think it's practical to implement the whole XAML engine, including resources, dependency properties etc. Google for Xamlon, looks like they tried and gave up. Even Mono and Moonlight haven't tried target Windows Mobile. UPDATE: Moonlight just announced new feature “Platform Abstraction Layer” giving the potential to port it to any platform.
If very basic subset of XAML is enough for you, check this post: XAML & Windows Mobile (.Net Compact Framework) The mentioned project has a basic XAML parser.

Categories