С# free control (UWP/WPF/Winforms) similar to mxGraph (draw.io) - c#

Is there anything like js lib mxGraph (https://www.draw.io/) availabe for desktop c# apps? (Any GUI)
I know draw.io using mxGraph, which also has Java version, but i didn't find .net implementation. (in fact it has C# renderer, which renders graph to System.Drawing.Image without any interaction support)
I know there is graphviz and graphsharp, but there is no tutorial/user manual like mxGraph has.
I know there is telerik, syncfusion etc controls, but they are paid.
The thing is I need a diagraming tool for my app, and I don't want to invent a wheel.
But it seems like either I stick with undocumented graphsharp or create an Electron app (low perfomace, high memory usage)

This may help https://github.com/prepare/opendiagram .
Open Diagram is a .net diagramming component library for the .Net framework winforms environment.
I use a product that uses this, personally I have no experience in developing with it.

Related

Cross platform desktop development with HTML5 GUI

Short story: is there a way to write a desktop application with a GUI in HTML5 and core in a cross-platform language like python (or even C#/Mono)?
Longer story: I'm a C# developer, for small personal projects I seldom do, running both under Windows and OSX, I use C# (Mono) with a frontend leveraging on Eto.Forms
I'd like to understand if there's a mature way to achieve the same results using an HTML5 GUI, since I'd like to learn that and believe it could be a good option for near-future Windows desktop UIs (or otherwise a nice tool to have in my skillset). Of course if the code running behind the scenes is C# I'll be more than happy, but also getting my feet wet in another, maybe more cross-platform like python would be good.
At this stage I'm not interested in any mobile-oriented solution.
Electron (formerly Atom shell) has really matured as of late. In fact it's what VSCode is built on.
There's a great tutorial and starter code on using Angular 2 and Typescript, and you can even use VSCode to write and build it.
For me this is the best way to transition from the WPF world to HTML5.
the NW.js look pretty promising... you might even be able to use TypeScript which would be much closer to C# than plain ol' js. If you're open to using PHP, you can check out the nightrain project https://github.com/naetech/nightrain.
Give http://www.tidesdk.org/ a try.
Your app will run on Windows 8, MacOS and Linux. You can use HTML5, Javascript and CSS3.
But you can also extend the functionality of your app with a scripting language you are comfortable with. TideSDK currently supports Python, PHP, and Ruby.
I have recently worked with Chromium Embedded Framework, basically a browser component for WPF an WinForms. It works very well and provides kind of a two-way interoperability from website to .NET-app and vice versa. Basically, you:
Create a WPF desktop app
Include CEFSharp and place a full-screen browser on the window
Call methods in JavaScript:
// .NET
var mainFrame = browser.GetMainFrame();
mainFrame.ExecuteJavaScriptAsync("any js code");
Bind a .NET-object
// .NET
browser.RegisterJsObject("boundObject", this);
Call methods on a bound .NET-object from the website/JS:
// JS
boundObject.someMethod();
On this basis you could build a mediation layer (ViewModels, controllers, ...) between HTML/JS-UI and .NET logic...
I wrote an APP with http://kivy.org/ it is capable to create apps for different systems.
Qt node https://github.com/arturadib/node-qt seems also interesting, but i did not test it myself.
And last https://chrome.google.com/webstore/launcher
You can create web apps for chrome, which should run in supported systems.
Kivy is a Python solution. Qt node is maybe what you are looking for.
Here are some nice tutorials for kivy:
https://www.youtube.com/playlist?list=PLQVvvaa0QuDe_l6XiJ40yGTEqIKugAdTy
NW.js
But it's Javascript (node), not python nor C#.
A very interesting project I think is Chromium Embedded Framework. You basically embed a (stripped down) web browser in your application. For python, many GUI Toolkits are supported. Check this for more information.
Since you are used to C#, maybe Java with JavaFX and FXML is an option. FXML is not HTML but you can style it with CSS as well. You can also use Scene Builder with it for faster UI creation. Many JVM languages support this toolkit so Jython instead of Java will also work. I will recommend Java however, because the support for other languages, while there, is not perfect yet.
Using C# and the Windows App Store WebView is also an option. You can check MSDN for more information.
I am sure there are other options (Kivy, Node.js, etc.) as well. Some of them are already mentioned in this thread.
I would recommend Node-Webkit which is based on nodejs.You can still use some python scripts to do some backend job integrated with Node-Webkit which is easy to deal with.I've already saw some successful applications using this(like wunderlist).TideSDK is another choice but the python support in TideSDK is not mature enough.The Node-Webkit project hosted at
https://github.com/nwjs/nw.js/

Win CE 7 application development

I have requirement that we need to develop a rich UI application(similar to WPF or silverlight). The target device is having embedded OS Win CE 7. how can i achieve this, after so much R&D i got to know that
1. we have to user Silverlight for GUI and C++ as backend coding
2. we can create the MFC application using some third party SDK we will not be able to get rich UI
Also, i read that we can add components in WIN CE 7 for compact framework.
Is my above understanding correct, can someone throw some light on this?
Just to add my 2 cents to Chris and Paolo's replies, if you are not building the OS image for the target device or, at least, can't control the features it supports, your choice may be limited by the set of components that were included into the OS image provided with the device.
Windows CE is highly componentized and both the badly named "Silverlight for Windows Embedded" (XAML) and .NET Compact Framewor runtimes can be left out of the OS image to save storage space and memory.
The XAML runtime can leverage graphic acceleration (if the HW you are using provides it and the BSP includes drivers to use it, of course) and this may lead to a more responsive system, compared to a full .NET implementation.
I would also try to stay away from MFC for new implementation. The only good reason to use MFC is that you already have an UI framework that fit your needs and is based on it.
Currently on CE you can decide between an easy to design and rich UI with complex to develop and debug code-behind (XAML) or an easy to develop .NET application with an ugly windows 95-like UI that require lot of work to be "beautified". XAML in the hand may merge the best of both worlds (requiring additional cost and two heavvy runtimes on your target, but this may not be an issue if you have a powerful x86 machine or a graphic accelerated ARM Cortex).
To develop application on WEC 7 you need an SDK built from OEM that give you the target board.
If you want to develop on a Virtual PC image you need Platform Builder to use CEPC BSP and create an O.S. image and the corresponding SDK.
After that, you can develop using Silverlight only with C++ but you can use .Net Compact Framework and managed code for Windows Forms development.
Paolo.
It really, really depends on both your definition of "rich" and the graphics capability of the hardware you're targeting.
CE 7 supports the .NET Compact Framework. Many people will say that you can't do "rich" UI in the CF, but that's not really true. You can't do it with the standard controls, but if you do your own custom control drawing, you can do pretty well. Yet, it's a lot of work, but it can be done. The limitations here are in alphablending (not fun to get working) and animation (also not fun), but with dedication you can work around many issues.
CE 7.0 also supports "Silverlight for Windows Embedded" (a.k.a. SWE). First thing to know there is that it's really not Silverlight. It's a XAML rendering engine, but any other Silverlight assets you might have won't work with it.
SWE supports only C++, though since it is COM based, it can be wrapped in CF classes and then used from managed code. I've seen a couple of companies do this, and one even offers it as a product.
MFC is available, but since MFC was crap even 10 years ago, I definitely wouldn't use it today. If you want to use C++ but not SWE, there are better options than MFC. STL and WTL come to mind for windowing apps.

How we can call third party windows app like skype and fill username and password using c#? [duplicate]

I'm looking for a library that can be used in native .NET code, just like any .NET assembly. The purpose of the library must be to automate Windows (push a button, select a window, send keys, record & playback, that sort of thing).
So: the library is supposed to be used natively in .NET, but the automation itself must be able to target any native or .NET Windows application that can receive user input.
Suggestions so far:
benPearce suggested AutoIt. It has a DLL, which is native Win32 but not native .NET and cannot be used without use of .NET Interop.
Chris Dunaway suggested Global Mouse Keyboard Lib. This came closest, but is not an automation lib. It just helps setting up keyboard and mouse hooks.
pm100 suggested Microsoft's WPF UI Automation. This one is pretty good, albeit that it's not available if you develop in .NET 2.0 and it requires the WPF to be installed on the system. It can, however, automate everything from Win32 apps to HTML in a browser.
JasonTrue suggested WebAI from ArtOfTest. This is a testing framework mainly geared towards browsers and web applications. It is unfortunately not well suitable for use for Windows automation.
If nothing else appears available, I'll probably choose Microsoft's UI Automation and upgrade any projects that require it that are still in .NET 2.0 to .NET 3.5, if possible. But I hope for a more widely applicable automation framework (.NET prior to 2.0 does not need to be supported).
Have you looked at the White framework?
I have used AutoIt in the past with success.
microsoft's own built in one is fine
http://msdn.microsoft.com/en-us/library/ms747327.aspx
not restricted to wpf as some seem to think.
If you haven't seen it yet, and a commercial library is acceptable, you might check out Ranorex:
http://www.ranorex.com/
I used Ranorex 1.5 quite a bit to write small C# UI automation utilities. It was pretty effective! Development seemed faster compared to using the MS UI Automation API directly, since Ranorex has a lot of useful convenience methods already available.
I haven't used Ranorex 2 very much yet, though.
In Ranorex 1.5, there was also support for traditional Win32 development in C++, but I didn't use it. As far as I know, that's still available in Ranorex 2.
I can't speak to the quality of the record/playback support in Ranorex since I never used that feature.
One final plus: Their support team was really responsive and helpful anytime I emailed them.
This library is pretty interesting and is fairly simple. Perhaps it will help you.
Check out Tools for automated GUI testing on windows
I would still suggest FlaUI for autoamating .Net Desktop,Mobile apps. Its based on Microsoft UIA libraries and have support for external controls like the DevExpress Grid too
Moreover, it is built on top of TestStack.White so indeed a very good library and has a github page also
I have used WebAii from ArtOfTest with a fair degree of success in automating integration testing for a Silverlight app. It also supports WinForms and Web applications.
Microsoft UI Automation, the successor to Active Accessibility, can do almost all of the Windows UI automation you would need.
How about CSharpScript, here's an article about it on Codeproject, and here's the link to the main website. Furthermore, it is familiar C#, scripted which can be used to automate anything.
Hope this helps,
Best regards,
Tom.

WPF with C++, is it possible?

I have my main program in C++, but now I need to build a beautiful application and I know that WPF is easy and makes for beautiful apps. Can WPF work with C++ or C# and C++? (If yes, how?) Is WPF the best thing for me?
You can use WPF in a managed C++ project, but you're better off keeping your C++ in a separate assembly and referencing it from a C# or VB WPF project.
Yes, you can develop a GUI using WPF framework in Managed C+ or C++/CLI. But they're not Standard C++, hence not cross-platform.
If you just want a GUI for your application written in C++, then you may try Qt as well. The advantage in Qt is that its completely in C++. Not Microsoft Managed C++. The second advantage is that its cross-platform toolkit. That means, you can run your app in Windows, Linux, Mac, and on other machines as well.
Have a look at its documentation
Qt Reference Documentation
It has lots of tools for fast development such as Qt Creator, Qt Designer and others. You can see all of them by browsing the above link.
WPF is dead along with Silverlight, remember, MS says its HTML5 only from now on :)
Using WPF in your C++ app can be achieved using hwndSource, but its not the optimal solution, for that you will have to create C# or VB.NET GUI app, and use it to communicate with your C++ app via some form of IPC.
There are alternatives, probably the best one is to write your GUI using Qt, which is very well respected. You can get similar features to WPF by writing using QML alongside the old forms-based system (which means you get all the development speed of using the old, boring text boxes and the like, and the fancy GUI benefits of using the new declarative UI system, all in the same system. sweet).
Of course, a decent option is to make your app into a back-end server process and call it from a web-server based HTML5 UI. That's pretty future proof, easy to deploy to clients, and as modern as you're likely to get.

Howto draw "pages" in a C# WinForms project

I want to display data on a Windows Forms project in C#.
The general sketch for the GUI is similar to Acrobat Reader or MS Word - meaning i want to display the data on several pages, and let the user navigate between the pages. The data i`m displaying isn't special, i just want to give the user a "page" feeling when viewing it.
I`m searching for a good starting point, preferably open-source.
I thought about using some kind of a reporting tool, such as Crystal Reports, is that a good idea?
Also, is better to use WPF then WinForms for this?
Any thought and recommendations are welcome.
Thanks.
It sounds like you would be better off going the WPF route. You have MUCH better control over how your "form" looks.
What you would want to do is define each "page" in a user control or something, then you can display each one however you like. WPF can handle the zooming for you, all you have to do is hook it up (look into transforms). I can't see WinForms doing this. I would suggest looking at this project on codeplex.
If this project is just for fun, and if you already are using Visual Studio 2008, then WPF is a good choice for this.
If you intend to make this a commercial project, however, I would recommend making it a WinForms application. WPF requires Visual Studio 2008 and .Net 3.5. Many Windows users (especially corporate customers) are still using .Net 2.0 and don't plan to upgrade soon. Some are even still on .Net 1.1 (or no .Net at all). .Net 2.0 comes pre-installed now on new PCs, and the installer for 2.0 is only 23 MB (versus close to 200 MB for the somewhat-buggy .Net 3.5 installer). Also, .Net apps can (potentially) be made to run on Mac, Linux and the iPhone thanks to Mono, but Mono now is somewhere between .Net 2.0 and .Net 3.5, so WPF applications can't be cross-platform yet.
Here is a previous answer to a sort-of-similar question about doing a zoom effect in .Net with GDI+:
Auto sizing zoom on an image in .NET
This should give you a start on doing this kind of graphics work in .Net (and it's as open source as it gets).
Update: If you want to render XPS documents (easily), then you should use WPF. However, this choice would effectively eliminate the possibility of making your application cross-platform via Mono, at least in the short-term.
An alternative would be to export your documents as PDF files, or use Adobe Acrobat to convert your XPS documents into PDF files. Here is a link to a CodeProject sample that renders PDFs entirely in C#/.Net 2.0 or older:
http://www.codeproject.com/KB/showcase/pdfrasterizer.aspx
This code would allow your WinForms application to render a PDF file as a collection of Bitmaps (one for each page), and from there it's a relatively simple matter to display these Bitmaps in the manner you describe (with zoom and everything). Because the project would use .Net 2.0, it should work in Mono without any modifications.
TabControl doesn't do what you want?
It sounds like what your trying to do is make an application behave like a web page. Would just adding a WebBrowser control suffice ?

Categories