how to use ProgressRing in a WPF application for windows - wpf

As simple as in the title, I'd like to know how to use a ProgressRing on my gui. I can't figure out how to import the Windows.UI.Xaml.Controls namespace in which seems to be located.
Thanks!
Eugenio

I don't think you can add a reference to a Windows Store Apps DLL to a WPF project, they are built against different versions of the framework.
You could however use a ProgressRing from a different WPF targeting DLL; MahApps Metro has one https://mahapps.com/docs/controls/progressring (source is on github so you can just take what is needed without having to jump fully into the metro style)
Or you could implement your own following a tutorial http://henryzhu1997.wordpress.com/2013/06/18/creating-a-progressring-for-wpf/

Related

Does the new SvgImageSource class designed for UWP can be used in WPF project

It seems that a relatively new class: SvgImageSource can only be used in UWP. Is there any way to use it in a WPF project and how?
Please take a look at this framework:
SharpVectors
The other way is to convert your SVG files to XAML path geometry and using them easily.
It will be possible to use any UWP XAML UI in WPF using XAML Islands. This is currently available as a preview using the WindowsXamlHost control which is part of the Windows Community Toolkit. Also note, that when using UWP controls in WPF apps, the app will then work only on Windows 10 client PCs.

Using AdControl to display ads in a WPF application packaged for UWP

I (appear to) have successfully created a UWP package for my WPF application using the following guide:
https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net
Now I would like to take advantage of the AdControl class to display banner ads in my project, as detailed here:
https://learn.microsoft.com/en-us/windows/uwp/monetize/adcontrol-in-xaml-and--net
Is this possible? I don't see the "Universal Windows" section under References for my WPF project, which I can guess is because it’s not an original Universal Windows project. I do see it under References for the UWP package wrapper project I created using the guide above, but that doesn't help me show ads in the WPF project.
Any help appreciated.
You can add Universal Windows reference and use the API in your project as described here but you cannot use AdControl since XAML/UI in WPF is not the same as XAML in UWP and the AdControl is a UWP XAML control:
As mentioned above, there are exceptions to the rule that Windows 10
APIs are accessible from PC software. The first big exception concerns
XAML UI APIs. The XAML framework in UWP is different from the one in
WPF and you really don’t want to be mixing them up, anyways.

Can I compile my Silverlight 4 application as a WPF?

Just curious I heard this somewhere... I doubt it is true...
You can't do it directly, but you can create a WPF project and add links to the Silverlight files.
If you don't use Silverlight-specific code, you'll have a WPF application.

Exception when add Silverlight dll in WPF application

When i added the silverlight dll in the wpf application , i got the following exception.
Could not load file or assembly "System.Core, Version=2.0.5.0". The located assembly's manifest definition does not match the
assembly reference.
This is happening only in VS 2010 professional Beta 2.
You cannot use Silverlight directly in a WPF application, as they do not use the same version of the .NET Framework, thus the error message
Could you give some more details on your scenario ?
If you have a WPF app, you have more than what Silverlight can give to you.
If you are building a solution with multiple products, and one is WPF for the desktop, one is Silverlight for the Web, you need to create 2 different projects in VS.
Take a look at the source tree here:
http://expressionblend.codeplex.com/
Specifically, the Expression.Samples.Interactivity.Design branch.
This shows a few examples of how to put in property editors for use with Blend. I'm not sure if the same concept is transportable to the Cider design surface, but heck, Blend is nicer for pure XAML editing anyways. :)

How do I build a Style Library for use in Silverlight Class Libraries?

I have a Silverlight application that is built from a set of Silverlight class libraries. I would like to create a common Silverlight library that contains a set of resources used to define the styles used for all the Silverlight UI libraries. This would be simlar to the <Styles>'s defined in the node within App.xaml file.
Is this possible? And if so, how would I implement?
While this is possible using WPF (via Dynamic Resources, see this video and fast forward to 12:00), I don't think this is possible yet in Silverlight. The closest thing you have to this is the themes in the Silverlight toolkit. There is a comment on that page by the team stating that you can't change themes (or resource styles) at runtime in Silverlight 2:
unruledboy, We do not support changing themes at run-time as this is not an ability supported by the Silverlight framework.
So I think themes is the closest thing available right now.

Resources