I'm writing a UWP app, and for some reason I'm unable to reference PresentationFramework.dll. It contains some WPF controls I want to use (specifically, System.Windows.Controls.DataGrid, but they aren't available under Universal Windows >> Extensions in the reference manager. Why is this, and how can I fix it?
TL;DR: You can't use WPF controls in UWP.
WPF and UWP are two totally different APIs with a different .NET framework. While WPF has access to the full .NET Framework, UWP has a much more limited API. If you want to read more on the different platforms and compilers, this msdn blog post is a good entry point.
You are thus unable to add any standard dlls as a reference to an UWP app. If you want to share code between WPF and UWP, you'll have to use a Portable Class Library, in which you target the platforms you need.
And as the XAML namespaces for WPF and UWP are different as well, you won't find many portable controls. So for UWP development you'll need to use UWP controls (equivalent to their WPF counterparts). Bonus tip: if you're looking for 3rd party controls, you can also look for 'winrt' controls as winrt was used for Windows 8/8.1, but it's the same technology.
I know this is an old question. Not even going to research what came out when. There is a DataGrid for UWP as part of the community toolkit:
https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/datagrid
It's really frustrating though, because it doesn't seem to do a few things that the WPF version does, and these are the few things I needed it do do.
Microsoft really needs to come up with a new naming conventions for its 114 different frameworks and platforms. Controls should be named DataGridWpf, DataGridUwp, etc.
It's super hard to search for examples of the UWP DataGrid control and find thousands of examples for the WPF version. Just my two cents. And for the record, it seems like there are about 5 active links to examples on the UWP version. Arrg.
/And for added fun, Telerik and DevExpress have UWP data grid controls, which they also call DataGrids.
Related
We want to create an app, which works on multiple platforms showing a lot of lines and graphics. Since we have a Xamarin license and this app will not require any native look Xamarin.Forms is our choice. On the other hand we need mentioned graphics so we are thinking about using MonoGame (since we already know this framework). The only thing in here is, we would like to use some scrollviews in overlays and maybe the appbar (navigation bar on top). For this we had some problems in our test.
Now we are unsure what to use and would like to know if there are any other approaches to use Xamarin.Forms and OpenGL in parts.
Xamarin.Forms has a OpenGLView View and it can be used within a Xamarin.Forms page amongst other controls.
There is some examples, using Xamarin.Forms with this here.
Do note, however that this is only available in iOS and Android however.
Along with MonoGame, you have Urho which is mentioned on the Xamarin website that you may want to look into, link here. As to whether Urho is compatible with Xamarin.Forms I do not know.
I've got a simple and clean GUI to do for windows XP embedded, but I'm very new to C#.
Many topics I've found discussing WPF on XPE seem to be dating back to ~2007, so I'm here hoping for current up-to-date information.
Basically, how well supported would WPF be for this task? Are there circumstances which makes this a very bad design path? (what .net version?)
The app will be a kiosk mode gui which will contain some simple buttons, textfields and maybe a drawing canvas element.
It should at least be possible for you to get .Net Framework 3.0 installed on XPe (http://msdn.microsoft.com/en-us/library/bb417255%28WinEmbedded.5%29.aspx). However, depending on the performance you've got available and the kind of UI (if its simple enough), you might opt to choose WinForms instead of WPF.
I really like some of the pre-built controls available in the Silverlight 4 Toolkit
I understand the CLRs are different but I was hoping that I could download the source and recompile for the CLR that WPF uses.
Is this possible? The WPF Toolkit is very basic by comparison and doesn't have encouraging reviews.
Many Thanks.
Have you looked at the Extended WPF Toolkit: http://wpftoolkit.codeplex.com/
Well, both WPF and Silverlight uses the same CLR version (runtime v2 or v4). The difference is in these two frameworks (libraries) theirselves.
Theoretically, it's possible, but depends on concrete code.
This might help:
Differences
Code reuse in WPF and Silverlight
It is certainly possible, but you won't be able to recompile for WPF. You'd need to create brand new project files (csproj) for WPF or convert the existing ones manually.
In addition, you'd have to target WPF 4, since the Silverlight toolkit makes heavy use of the VisualStateManager. Or you could get the VisualStateManager from the WPF toolkit, and target WPF 3.5 SP1.
There are going to be several supporting classes and/or class members in the Silverlight toolkit, which are not needed in WPF. Such as controls that mimic the IsMouseOver property using MouseEnter/MouseLeave events. These would need to be removed and updated to leverage the WPF version.
After doing all that, it should compile for WPF. You may run into some issues during runtime though, due to quirks with differences in the frameworks. Each of these would have to addressed individually.
I've been looking for a good cross-platform charting library to use on a .NET project intended to be run on both Windows and Linux, but everything looks to have a dependency on WinForms controls, seemingly including ZedGraph (not to mention that ZedGraph looks a bit, well, dated).
Microsoft's Chart Controls for WinForms/ASP.NET look great, but like I said, have a dependency on WinForms controls. I know Mono includes WinForms support for Linux, but I'd rather not have to have Linux end-users install WinForms for what's going to end up being a GTK# application.
Does anyone know of any .NET charting library out there that don't depend on WinForms and that has good visual appeal?
P.S. As an example of a nice visual style, on a different PHP-based project, we use pChart (which I would link, but I don't have enough rep for it).
P.P.S. I've thought about using the Google Chart API, but I don't want to require a network connection just to generate charts.
They require Windows.Forms, since GDI (graphics) functions reside in that particular library. Any other chart control will have to use either 3rd party library or provide its own graphics toolkit.
The best thing I could find is Apache FOP:
http://xmlgraphics.apache.org/fop/
You should be able to run it from command line, or integrate it using IKVM.
Finally, why don't you want Windows.Forms library? As far as I know, mono provides a sufficiently working one.
I was working with a WPF application and I decided that the controls and graphics I wanted to display on the grid might look better if it was a silverlight component.
I thought this way because of all the cool silverlight controls that look very flash-like.
But now that I have gottem my Visual Studio 2010 set up with SIlverlight, it seems that every silverlight app I can make are ASP.NET in nature. It seems that instead of a cool GUI control to make, Silverlight is telling me that it is primarely a dataflow sort of application for the web.
What is the relationship, if any, between WPF and Silverlight. Can I or can I not put a silverlight control into my existing WPF application?
It's my understanding that Silverlight is like "WPF lite", and that in many ways they are almost the same thing but made for different purposes (desktop vs. web). If you want your wpf application to have a different look, you don't need to bring in any other controls from silverlight, because you can simply re-style or re-template them to suit your needs (which you can also do in silverlight). But you can't simply use silverlight controls in wpf because they're compiled to run on different runtimes.
Silverlight does have a number of un-official controls in the silverlight toolkit which are not included in wpf or the wpf toolkit. They are open source, and if you really want, you could port them to wpf, especially since the code is very similar to wpf.
Silverlight is essentially a subset of WPF that is used to create web-based applications.
You might be able to jump through some hoops to get a limited Silverlight application running in WPF, but I doubt it would be worth it...
I know others may point out that SL is WPF lite.
But hope you find out they are different frameworks at least right now though they share XAML, and a similar model.
Not sure if in the future they become the same, but keep the differences in mind is critical at this moment. :)
We know DevExpress is now shipping the same code base of their components for WPF and SL, but that does come after putting a lot of efforts.
http://community.devexpress.com/blogs/ctodx/archive/2010/04/20/merging-our-silverlight-and-wpf-ui-controls.aspx