c# Gui Update from Realtime-System nice Solution ? What Pattern? - c#

i'm looking for a nice solution on my Application. For Backgroundinformations:
i've got a real-time System in c++ on Linux. And i've a Winforms Application (soon WPF) on a Windows XP (soon Windows 7). The Communication is an TCP-IP Stream.
My Solution now is a Gui-Timer that updates the Gui with the Data from the ReaTime-System every Tick.
I think thats not a clean Solution. I want to make it better. But i dont know how.
Can you help me or can you give me a keyword that a can search it by myselfe ?
The Gui dont need to me real-time.
Thanks in advance.
Nice Wishes
Manuel

Only for WPF: The binding system of WPF is perfect in your case. All you have to do is to bind your code or data to controls and WPF updates if the bound data is updated.
See http://wpftutorial.net/DataBindingOverview.html for more information.

Related

WPF or Winforms for a beginner? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
WPF vs. Windows Forms
I am starting to learn C# and wonder, when and why I should choose WPF? I also wonder what WCF is. Are they both GUI related stuff to head into?
If I can make a GUI with Winforms, why should I make a GUI with WCF/WPF?
WPF is a more modern technology than Winforms. It has better layout handling through the XAML code and allows for more advanced GUI patterns such as MVVM (Model View View-Model) built on databinding.
If you start out fresh I would suggest going for WPF directly. Stay out of the databinding and MVVM to start with and just put your code in the code behind file.
WCF is Windows Communication Foundations which is not directly related to GUI programming, although many client applications written in WPF or Winforms uses WCF for communication.
WPF is also a great method of deploying updates to multiple users simultaneousnessly. When you publish an update in WPF it is immediately available to all users and does not require installation to run. The user simply hits the xbap and they begin downloading the newest copy of the application.
On top of what has been already said, I'll just add that learning WPF will give you excellent foundations for Silverlight, in case you want to try something different one day (or - less desktop oriented).
You use WPF to provide rich contents in UI. http://msdn.microsoft.com/en-us/magazine/cc163662.aspx

Host WPF Application online with Databinding

3 months ago i developed a WPF Application offline,and now i need to host this Application online.
This app gets the function to Add,Edit,Delete,Search (and so on ...) records in the database so it use a Databinding and now i need to host it online so the client can connect on the web to insert or update the data .
Can you suggest me which is the best way to host my App online using the Databinding?
Thanks so much for your attention.
..if you need more details don't hesitate to ask me . :)
Cheers
It sounds as though you'd want to convert your WPF application to Silverlight. Silverlight applications run in the browser, and contain a large subset of the WPF features, including XAML and Databinding.
While it's usually not an exact 1:1 port from WPF to Silverlite, it's close. There are many resources on the topic if you Google "Converting WPF to Silverlight".
If you've used MVVM or its ilk you might be able to get away with just modifying your .XAML files without having to alter the .cs behind the view. Googling around suggests many people have had to completely rewrite their views though, here is a walkthrough by someone who's been through the process of converting their WPF app to Silverlight.

Program Advice Directx with C#

What I am using:
Visual Studio 2010
Windows Media Center
Language C#
The Program
A part of my program needs to display movies by their covers and be able to scroll through them, much like netflix. I was told that directx would be good to accomplish this. Basically I just want it to be easy to view, use, and flow nicely.
Help?
Any Ideas as to what to use. (I was also looking into writing it as a pluggin for windows media player, but i read somewhere you can only have html based menus?)
Any suggestions would be appreciated.
Thanks
-Scott
Have a look at the following.
http://channel9.msdn.com/Blogs/scobleizer/Charlie-Owen-Your-first-Media-CenterVista-application-and-a-look-at-their-secret-room
The problem with using Direct3D for an application like this is that you have to start creating your own window manager.
You don't have the default events available to you and you will have to basically create your own GUI which is easier in WPF as those events and helpers exist.

Non-standard UI in C#

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.

C# TWAIN interaction

I'm trying to set up a C# application which uses TWAIN example from code project
This works fine except that I need to cast Form to IMessageFilter and
call IMessageFilter.PreFilterMessage() to catch TWAIN callbacks.
Also I need to start this filtering by calling
Application.AddMessageFilter();
Is there a way to do same thing in WPF Window? (To add message filter and catch TWAIN callbacks).
Another totally high level question:
Does anybody know about alternative C# TWAIN libraries\wrappers?
Thank you.
I've just wrapped up the code from Thomas Scheidegger's article (CodeProject: .NET TWAIN image scanning) into github project
I've cleaned up the API a bit and added WPF support, so check it out. :)
It has a simple WPF application that shows how the message filtering works with WPF.
You could try it with the ComponentDispatcher.ThreadFilterMessage event. As far as I understand, it serves the same purpose in WPF as Application.AddMessageFilter() in WinForms.
I thought TWAIN is considered obsolete. Maybe take a look at WIA, that does this job since WinXP. There is also a sample at codeproject.
About the WPF related question, no idea, I only used it in windows forms apps.

Categories