-
May 15th, 2013, 04:03 PM
#1
[RESOLVED] Would WPF serve this need?
I've got a prototype of a user-interface I'm working on using standard VS.Net Winform stuff - typical ugly looking buttons and list views and such.
My partners (business partners - not technical) - would like the UI to be more HTML-like - nice colors - buttons that are more like "labels" in a web form. Basically much prettier for showing the potential clients (and VC-people!!).
At any rate - I was looking at what WPF looks like from this link that Mendhak had in the FAQ here...
http://www.codeproject.com/Articles/...de-Part-1-of-n
Seems the vector-graphics part of WPF allows for very powerful UI-looks.
Is any spot clickable - any spot can have a code-event behind it - like HTML/Javascript in a browser?
And this is for an EXECUTABLE - right? WPF is for a winform with prettier looks - right?
Does the code-events actually fire the same way? In otherwords - I can migrate my Visual C# prototype to WPF and still use the same "event code"???
-
May 16th, 2013, 01:39 AM
#2
Re: Would WPF serve this need?
Not sure what you mean by 'spot' but every controls should also be clickable. There is also a code-behind in WPF but if you are new into it I would recommend looking at MVVM design pattern which suits well with WPF. Instead of using events (click, etc) in your UI you will instead bind your control into 'commands' that will execute what logic you need. And yes, the UI is a lot better since it can be easily configured, you can beautify your controls using templates and it should apply to all controls that is bound to your templates. Happy WPF'ing!
-
May 17th, 2013, 07:30 AM
#3
Re: Would WPF serve this need?
Hello,
Yes, you can essentially "port" an existing Windows Form application, driven by click events, and callbacks, into a WPF application. The User Interface is obviously far different, using XAML mechanism to do it.
What we would think of as a button in WinForms can be styled completely different in XAML. It can contain an image, a video, anything you want, but it is still a button, therefore still have the normal click event that you would associate with a button.
Now although you can simply continue down the event driven route, with direct coupling between your UI and the code behind, if you are going to start to use WPF, you might want to start in the right vein, and adopt MVVM as a pattern to separating the logic out.
Gary
-
May 17th, 2013, 08:23 AM
#4
Re: Would WPF serve this need?
The examples online are really hard to wrap my arms around - I've got a book coming from Barnes and Noble on Monday - hoping to follow that through some sample apps.
This is not a database driven app I'm working on - really at this time it's a proof-of-concept for showing off backend service results (that I've been working on for almost two years now).
Seems I have to learn how to use this expression blend thing - that makes the XAML files - right? Otherwise the XAML files are horrendous to look at.
I saw a CALCULATOR sample that was really cool - click a button and it shrinks and grows - really cool stuff.
-
May 17th, 2013, 08:27 AM
#5
Re: Would WPF serve this need?
Hey,
You don't have to be doing a database application in order to use the MVVM pattern. In your case the model would simply be the entities, or POCO's that you are getting back from the service. From there, you can populate the ViewModel, which in then you can bind to your View.
You don't "have" to use Expression Blend. The XAML editor that is now in Visual Studio 2012 is essentially the same thing as appears in Blend. Blend has some more advanced options like stoyboarding and population of sample data etc, but unless you "need" to, you should be able to continue working on the WPF application in Visual Studio.
Gary
-
May 17th, 2013, 08:29 AM
#6
Re: Would WPF serve this need?
I've only got VS 2010 - never got 2012 since I've been coding mostly Javascript and C++ the past year or so.
Does 2010 have the same XAML editor??
MVVM scares me (although I've not looked at it at all really) - is it for "discipline" of how you code - or does it have a real benefit?
-
May 17th, 2013, 08:38 AM
#7
Re: Would WPF serve this need?
Visual Studio 2010 also has a XAML editor, yes, but I think it would be fair to say that it is not as "polished" as the Editor in Visual Studio 2012. Still perfectly functional for what you would need for this though, and it would save you having to learn another IDE for now.
MVVM can be thought of as a discipline yes, but it does have some immediate benefits as well. For instance, if you wanted to switch out the UI for the application, let's say you wanted to have a Windows Phone Application, a Silverlight Application, a WPF application, an Android Application, and iOS application, if coded correctly, all the "business" logic of talking to the service would be done within the ViewModel. Then all you would need to do would be to swap out the View portion, and you would have extensive code re-use.
Now, that is a bit of sweeping statement, and all the pieces aren't quite there yet, but if you start to get into that mentality, then when all the pieces do come together, it opens up the possibility of "write once, deploy everywhere".
There is some really good work happening with Xamarin and MVVMCross, and others, you make this a reality. If you are interested, watch this video:
http://slodge.blogspot.com/2013/04/n...n-n1-days.html
Blew my mind when I saw it!
Gary
-
May 17th, 2013, 08:42 AM
#8
Re: Would WPF serve this need?
Thank you very much for info - I really appreciate.
It's amazing how many times us developers have to switch coats and learn a new language/paradigm!
-
May 17th, 2013, 08:44 AM
#9
Re: Would WPF serve this need?
Not a problem at all! Hope you get it all sorted out!
Tell me about it! It is hard trying to keep up with it all!
Gary
-
Jun 19th, 2013, 05:28 AM
#10
Re: Would WPF serve this need?
Originally Posted by gep13
Just got around to watching that video - wow - that was really cool. Thanks for that.
And WPF rocks - really enjoying the ability to trick out and polish the UI so nicely.
-
Jun 19th, 2013, 07:57 AM
#11
Re: [RESOLVED] Would WPF serve this need?
Mind blowing, isn't it!
Glad to hear that you are enjoying it. XAML etc takes a minute to get your head round, but once you are there, it can work in a number of situations, i.e. Windows Phone, Silverlight, Desktop etc.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|