Results 1 to 11 of 11

Thread: [RESOLVED] Would WPF serve this need?

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Resolved [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"???

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    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!
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  4. #4

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  6. #6

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  7. #7
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  8. #8

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  9. #9
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  10. #10

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Would WPF serve this need?

    Quote Originally Posted by gep13 View Post
    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
    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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  11. #11
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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
  •  



Click Here to Expand Forum to Full Width