Can we migrate "WPF C#" project to "WinUi 3 C#" project? [duplicate] - c#

Im developing a Desktop app with WFP, but I've to migrate it to UWP Windows 10. Does anybody knows what this conversion involves? How complex is it?
Thank you in advance for the help :)

XAML for WPF and WINRT is not same because lot of classes which exist for WPF are missing in WINRT library. So the porting may have lots of work to do.
This may be helpful to you: https://channel9.msdn.com/Events/Build/2015/3-741

If you are going to convert it from WPF to UWP be sure to keep an eye out for the next few things:
ASync calls
a framework with less options but same possibilities
depends on your code and programme, but if you are experienced it might only take a few hours :)

.NET in WinRT is a lot more limited than the one in WPF.
So the level of difficulty of porting directly depends to your app's functionality.

Related

c# crossplatform UserControl

I wonder if it's possible to create some platform-independent UserControls with Visual Studio or Xamarin. Actually I work on a Windows and Xamarin:Mac (c#) project which both should display a very complex diagram, so it would be extremely helpful if I could code the mathematic once and use it all over the platforms.
Is there a way to achieve this?
Thanks for your help
You can use Xamarin Forms for this purpose most likely - if there are platform-specific details, you can create a Renderer class for each platform. Check out the website for more information.
Hope that helps!

Windows 8 DirectX SwapChainBackgroundPanel Questions

I come from two distinct backgrounds: I have much experience with WPF/XAML/C# app development and equal experience with C++/DirectX development. I hear about the ability to use DirectX and XAML together and I get all excited, but now I have hit this wall.
I'm trying to use the SwapChainBackgroundPanel in a WPF application. But I'm trying to use C# as the underlying language. I keep running into issues where, regardless of the type of C# project I create (PCL, WPF, Windows Store) none of these types are defined [namely I've been looking for SwapChainBackgroundPanel and some other DX stuff like the device and etc.)
So my question is: how does this work in C#? I've seen the simple shooter example from the MSDN done in C++ and it makes sense; I get it. But I feel like I'm missing one of those "gotcha's" when trying to do it in C#.
Any advice, or maybe a link to an example, or at best a little tutorial on setting up a C#/XAML/DX app would be amazing. Thanks everyone.
There is no SwapChainBackgroundPanel available to a WPF app (that is in PresentationCore). The closest you are going to get is the D3DImage class, but it's not exactly the same. See this discussion.
I don't think you can fully utilize the DirectX capabilities of a Windows 8 Store app (SwapChainBackgroundPanel) from C#. You're going to have to do your DirectX work in C++ as in the example you described. You can certainly combine the three (Xaml, C#, C++) as in this example, but I don't think a 100% C# app is possible.
The answer is wrong. It is possible to fully utilize C# throught a wrapper.
I did this myself with SharpDx which is actually one of the microsoft recommendations to use DirectX in C#.
As for the choice of XAML Library, Universal Windows App 10 or Windows Store App 8 is the way to go. Use a SwapChainPanel instead of SwapChainBackgroundPanel.

An embedded application for windows desktop using .NET platform?

I'm rebuilding an Embedded application:
Prebuild application Specifications:
Use : For dispaying the captured images/video from microscope image capturing device on windows based PC or Laptops.
Sepcifications: Prebuild on .NET plateform using VC++
Flaws : Lacks some specified features.
Current Requirement:
Want to rebuild that entire application using C# and add some additional client features.
My Questions:
Is it feasible to develop such application in C#.net?
If yeh,What kind of resources available in C# to develop desktop embedded application?
Any references which show any of such kind of application?
Your suggestions on building this kind of application.
P.S. It is essential to buid it on .NET platform.
I think by "Prebuild" you mean "Existing". Why do you want to rewrite the complete application? As you have stated that the application is written in C++.Net. You can easily add all the new functions in C# and use that code from your existing C++.Net code.
Note: I'm making this answer CW because the question is hard on the limit towards some close reasons. Everyone feel free to edit and extend it.
Is it feasible to develop such application in C#.net?
That's a tough one...from the top of my head I'd argue that it doesn't matter. If you know C#, then build it in C#, if the client wants it in C#, then build it in C#. You'll most likely have to use COM-Components or API-Invokes anyway to accomplish this.
If it is a TWAIN device, you might be better of to stick with VC++, I found TWAIN on .NET a real pain in the a** and have given up on such features. Same goes for WIA, but that might just be me.
If yes, what kind of resources available in C# to develop desktop embedded application?
I guess you mean a Widget? In that case I have no idea, I never really looked at that (at least not on Windows). But as far as I know widgets on Windows consist of a data-backend and a HTML/JavaScript-Frontend, so you'll most likely have to develop the two separately.
Any references which show any of such kind of application?
I guess any WIA/TWAIN application would be a reference, at least your description sounds so.
Your suggestions on building this kind of application.
See your first question.

Windows Form or WPF, to code or not code

I am planning to develop a UI control suite (open source) on .net because there is hardly such things as free or open source out in the market. But I am not really able to decide the following factors before going into design phase:
Should I write it for Winforms only?
Should I write it for WPF only?
Or, should I write it for both?
Which one would be more effort effective in the long run and help the community better? Can you guys please help me to sort this things out?
'Writing it for both' is basically 'write it twice', as I can't imagine much would be shared.
I think if I was suddenly filled with the idea that the world needed yet more 3rd party controls, I would write them for WPF/Silverlight/WP7.
WPF, but it's just my opinion.
Windows OSs that are supported (XP, Vista, 7) all support it, and WPF is the future. I don't see Winforms' death in the proximity, but we should support things that are right now actively supported.
It's like developing for IE6 instead of Firefox/Safari/Chrome/Opera. Most of us don't see IE6 dying, but we have to move forward.

C# controls in a MFC Application

I am responsible for the User Interface of an application written completely in Visual C++ using MFC and some third-part controls. I would like to use C# (WinForms or even better WPF) to improve the application look&feel.
I would like some advices about how to do it. Links, articles, examples...
Right now the user interface is isolated in a single project and I don't want to compile the whole module with CLR. So how do I have to manage that from the architectural point of view?
I have already looked at the Internet for the subject and read MSDN information. I would like more detailed information...is it convinient? pros/cons? have you used this approach successfully in a "big" application?
I don't want to compile the whole ui project with CLR...can I just have all the .NET code in a isolated project and call it from the ui project? what's the best way to do it?
Thanks in advance.
A good starting point is the Win32 and WPF interop page on MSDN.
I found this codeproject article gave a good introduction to the subject of mixing mfc / winforms code.
When faced with the same problem, I made an ActiveX control in C# and used it in my MFC app. The folks at MS took out support for building ActiveX controls with .NET, but it's still possible to do so with a plain Jane COM class which has a custom [ComRegisterFunction()] and [ComUnregisterFunction].
Although MS would like to tell us that the /clr flag will solve our problems, it measurably slowed down my large MFC app.

Categories

Resources