What's the best way to convert a simple console application to a WPF? and I am a COMPLETE newb so be gentle!!
The console app displays information according to user choices.. real simple stuff, but I'd like to create a GUI for it in WPF.. and am looking for initial steps on how to go about it.
This, and this (video) might be worth checking out. They will get you started with building a WPF app, you'll need to figure out how to port your existing interface to WPF though, which might not be very straight forward because there is a large shift in building a console app (Console.WriteLine/Console.Read) and a GUI app with GUI objects with events and display properties.
I recommend jumping in with the links above and positing additional questions here when you get stuck.
First you need to think how the new interface will behave. A gui is different from console interaction.
Draw on paper the gui you want, buttons, text areas, etc.
Think about the logic and it should behave, i.e. wizard like, button interaction, etc.
Only then approach the implementation in WPF, for that look for some beginner tutorial, like ths
Related
Story
I would like to make an application with two parts:
1. Console
Normal, bash-like CLI, implemented by me. That would be the way of communicating with the user, processing information, etc.
2. HTML
I would like to print HTML somewhere on the screen. It would be updated by the console.
Question
What should be the approach here? I'm not sure if a Windows Forms or WPF application is good here. IMO, that's too heavy. Ideally, a console application + some additional process would be used. But I've never heard of anything like that. Could you give me names of some frameworks / technologies where this would be possible?
Or maybe the other way - create this application but emulate console within it. I'm not sure if this is feasible...
Hy.I am currently working on a application in windows forms c#.My application is almost finished but the design is awful,i mean is very simple.I've searched some things about WPF and i think is a very good way to improve my design...But my question is:For using WPF only for my interface..if i will make copy -paste of my code, and i will modify only buttons and colors....will my project continue to work?Or I should started from 0...?
Thank you
In general I would recommend to start from scratch. If you aren't doing a complicated architecture here and have simple event handlers for WinForms you can pretty much stick with the same structure in WPF.
Architecturally speaking it would have of course been better to isolate the business logic from the event handlers. In that regard you might want to take a look at MVVM (and the MVVM Light Toolkit) and Prism.
We have successfully put a WPF shim around one of our very large WinForms apps and hosted the WinForms parts inside of a windows forms host. This allows you to convert one part at a time. This might be a route to take if this project is bigger or you are not sure you will be able to convert the entire application in one shot.
If your win forms app is designed properly you should be able to reuse all but your UI code. In my opinion WPF is far superior to win forms and you should definatly consider using it but it will take some learning to get started, dont do thus if you have a deadline coming up soon.
I also recommend you to move to the MVVM and WPF anyway if your project it is not so big you can use only WPF for interface and copy and paste your code. But from architecture point of view using the MVVM pattern you can make better separation of the interface (View) and you logic (Model) if you will use MVVM in the future will be easier to maintain and change your application
I am building an GUI application to label time series data. With one track displays the time series data, the other track for the user to interactively label the intervals. I immediately recognize that the GUI of my applicatioin would be very similiar to an audio editing software.
So I opened Audacity and started to think about how to program its GUI.
My GUI programming abality is limited in using frames, buttons, labels, etc in the toolbox. But I don't know how to program these controls my self. For instance, a label track (see the above link), contains labels in it. The user can also drag the label to other time stamp.
If I want to program similiar GUI elements in .Net, what kind of techniques should I learn? Thanks a lot!
Going the winforms route, you would create a couple of custom controls (ie the data label, and the label series) that behaves the way you want them to behave and renders the way you want. Here are a couple of links on creating custom controls
http://msmvps.com/blogs/deborahk/archive/2009/10/13/winforms-user-controls-101.aspx
http://www.codeproject.com/KB/miscctrl/ScrollingTextControlArtic.aspx
http://msdn.microsoft.com/en-us/library/6hws6h2t.aspx
I'd hazard you'd be best off learning WPF as it'll give you the quickest route to customising the display of data - however be prepared for a bit of steep learning curve as it's a bit different from the traditional GUI.
If you do learn WPF you may find that the Dynamic Data Display library on codeplex serves as a good point for future customisation.
http://dynamicdatadisplay.codeplex.com/
many hints for learning wpf here:
Where to find good resources to learn XAML?
Good resources for learning WPF
https://stackoverflow.com/questions/59954/what-is-the-best-book-for-learning-wpf
I'm still learning C#, and I know don't know about WinForms yet but I will very soon. However I want to know how I would create an application which shows a customized notifier, like Growl on a Mac. Here's a mock up:
http://img25.imageshack.us/img25/3793/41151387.jpg http://img25.imageshack.us/img25/3793/41151387.jpg
Could anyone point me in the right direction? And I know I should learn more about C# before trying this, but I've always liked to peek on complicated stuff.
Take a look at this third-party WPF NotifyIcon control, I think it does what you want out of the box, hopefully something like this will be part of WPF in the future. I have used this one before for the exact same reason, and it is really good: you can use standard tooltips or "toast" popups, or create your own which could be just like the one in the example you posted if you wanted.
WPF would be a great place to start. you can make UIs in pure XAML without even touching C#
Here is an example of an "notification" implementation using WPF
Here are some reference links:
http://en.wikipedia.org/wiki/Windows_Presentation_Foundation
http://windowsclient.net/wpf/
You should probably look into WPF (Windows Presentation Foundation) to design some of the nonstandard UI stuff.
However, I would recommend becoming familiar with UI design in general before diving into nonstandard stuff.
Since you are starting from scratch, I would consider learning WPF rather than Winforms.
Here are two examples are a pop-up notifier in WPF:
WPF Taskbar Notifier - A WPF Taskbar Notification Window
PopUp window on a specific time in WPF?
WPF is Definitely what you are looking for if you want something like the image you provided. My project uses notification popups similar to that in the screenshot. Its really simple to get the wanted results after looking at a few samples of others who have done it. If you would like some help, you can send a message my way.
my main language is vb/c#.net and I'd like to make a console program but with a menu system.
If any of you have worked with "dos" like programs or iSeries from IBM then thats the style I am going for.
so, was wondering if anyone knows of a "winforms" library that will make my form look like this. I dont mind a "fake winforms look" or a console application but thats how I'd like.
I've used iSeries extensively and I remember exactly what you're talking about. To simulate this look and feel in a C# app, you'll want to create a console project and write text to different areas of the screen with the help of the Console.CursorTop and Console.CursorLeft properties, then calling Console.Write or Console.WriteLine to write out the text in the previously set position. To change colors, before calling WriteLine you'll want to use the Console.ForegroundColor and Console.BackgroundColor properties.
You'll need to listen for input and upon finding a tab character, your program can use its own internal logic to determine where the cursor should appear next (on the next line in the same column, for instance, to simulate those left columns of input fields in your screenshot).
Doing this with a Windows Forms app will be a little trickier and you'd definitely want to write your own control for it (possibly sub-classed from one of the many types of standard multi-line text controls already available).
It's a good question. For many Use Cases the standard Windows (or other windowing) paradigm can be overkill, intimidating, and confusing.
Back in DOS days there were a number of "Windowing" libraries that created various abstractions for doing this.
[After Googling]
Here's a site that lists various libraries including a several that appear to be of interest.
A resource like this would also be handy for Mobile apps, where mouse-driven window apps tend to be not the best fit, especially for workflow-type processes. The Console is a pretty universal lowest-common-denominator abstraction available in most every environment.
You are looking for a curses like library but for windows. And usable from VB & C#.
Curses provides for a even richer text based UI than even iSeries. All sorts of widgetry!
Windows is not really supportive of text interfaces whether on purpose or not so are out of luck.
But ...
Well, how about MonoCurses? I don't know if it will work though. Also look at PDCurses.
And if you don't mind using Python for just the front-end see this.
There are a couple of webifiers or screen scraping programs for iSeries that will create a web or windows user interface on top of your iSeries application. I have never used any of those so there is not a particular one that I can recommend, but you might want to look their for inspiration or reuse.