What is involved in making WPF web-based application? - wpf

I am developing an eCommerce site as a project for a class and I've only done mostly console application programming. The site is to use WPF, and is either web-based or mobile (and use Adventure Works db). I'm not sure what exactly is involved as far as programming technologies.
I became confused as I did some searching and saw terms like .xbap and wcf. What is the general overview and relationships of the technologies involved to develop a web app that is an eCommerce.

WPF is a technology designed for RDA (Rich Desktop Applications). You can't use it to build a website. Silverlight is a technology designed for RIA (Rich Internet Applications), so it is clearly better for your use.
You told about mobile... What do you mean ? Should your website be used on a mobile device ? In this case, you shouldn't use any of these technology because of interoperability...
If your project MUST be WPF, so you should read about XAML, WPF Binding, MVVM (not mandatory at first, but can helps to design your app).
If you could give us a little more precision about your project, we'll help you more efficiently.

Related

Migration to new technology

My org is currently in Winforms and we are renegineering our complete system which has following parts
- It is a heavy businesslogic desktop application
- Should support part on web/multiple devices (handheld)
- Part of it to be exposed as enterprise solution.
To define the target system, platform and language for such a system (timeline are to create by mid of 2016)
1. Can I replace heavy Desktop application with MS Application?
2. Should I create such DS Application with .net 4.0 WPF? (I am currently on Winforms so to me moving from Winforms to WPF or HTML5 is same)
3. I would prefer to move to HTML5 for the reason that my web, devices and desktop applocations are taken care - but do not have a path for DSA + HTML5 with WinRT
Please advice. Any other solution/suggestion also is welcome.
It really depends on what direction your company wants to go.
If you want to go down the desktop only route, then yes, WPF should suit your requirements. I would suggest using the MVVM Design Pattern, with the Repository/Unit Of Work Pattern.
If you want to go towards the Desktop/Tablet/Mobile route, then you have the option of developing an Windows App, or a Website Application.
For a Windows App, you're looking at developing Microsoft Store Apps (I'd suggest a Universal App). If you want to do this, you might as well wait for Windows 10 to be released, as universal apps have grown up since 8.1.
That leaves Web Applications. There are a myriad of options to choose from here, most common of those would probably be ASP.NET, and things like AngularJS. Please note that I'm not saying that these technologies are the best, but they are just a couple of options. It's really up to you to research the frameworks and libraries that suit your requirements.
But like I said, it really depends on what your company wants their application to do, and what devices will be compatible.

Silverlight is web development language or window application?

I am new to this technology. Actually I am confused, Silverlight, is it a web development language, desktop application or both?
Can I develop web site using Silverlight?
Silverlight is a subset of WPF. WPF is used for Windows based application and silverlight is used for web based application. However both use XAML language from UI perspective. http://www.lynda.com/ has nice videos for learning Silverlight.
Actually I am confused SilverLight is web development language or desktop application or both?
Both (as well as being usable for development targeting XBox 360) … although its use for client side web development is something of a joke (as it is like less well supported Flash).

MVP or MVVM framework for both WPF and .NET CF 3.5 development

I am creating a draft architecture outline for a disconnected client-server platform, that involves multiple different client types. I need to support: web clients, desktop workstations and mobile devices (WM 6.x now and Android later).
I am searching for a MVP or MVVM based framework that would let me to reuse as much of the code and architecture as possible between clients, while:
using WPF for desktop development
using .NET CF 3.5 for Windows Mobile development
This framework does not obviously need to support Android, however I am considering Mono for Android to develop the Android client (for easier maintenance of the whole platform), so portability would have been an added asset.
So far I ruled out:
Prism (does not support WM based mobile devices - Windows Phone 7 only)
MVC# (does not support WPF)
I would appreciate any hints that would aid in researching the subject further.
These MVVM Frameworks work with Windows Phone 7:
Caliburn Micro
MVVM Light (it doesn't advertise it, but I've been to a demo where it was used on WP7)
ReactiveUI (Uses the Reactive Extensions for .NET)
My personal favorite is ReactiveUI, but if you've never used the Reactive Extensions it can be a brain burner at first.
As for UI Composition (you mentioned Prism), there aren't a lot of options, mostly due to reflection restrictions on the phone. I have seen an article where someone got basic MEF working on the phone and MEF is probably all most people need in this situation. You can check out that article here.
Hope this helps.
In my opinion, this would be a custom Framework with a mix of UI Processes for different client types. The business logic or entities can definitely be reused to suit the needs of the view.
I did the same research and I concluded the following (which I did not implement yet):
There aren't any open source MVVM frameworks that support .NETCF. You
can only find MVC or MVP, but not MVVM.
Suggestion: get the source code of an Open Source MVVM framework that supports the Full/Desktop .NET, and see if you can adapt it(so that it recompiles) to the .NETCF. I found the following two, which also support the other platforms that you mentioned:
MVVM FX for Windows Forms and Visual WebGUI - Home
MugenMvvmToolkit
Other than that, I don't see any other way of doing this.
HTH,
MVVM wouldn't make much sense in Windows Mobile + .NETCF since you don't have INotifyPropertyChanged and implementing Model-View-Presenter in WPF or any INotifiyPropertyChanged supported framework wouldn't be as effective as Model-View-ViewModel
You can share assets between the full and compact framework by moving most of the business logic into a seperate class library (or several) that target the .NETCF. You can reference a .NETCF library from a full framework project, but not the other way around.
Check out this very good article by Daniel Moth describing how to share assets between the compact and full framework:
http://msdn.microsoft.com/msdnmag/issues/07/07/ShareCode/default.aspx

Which to use - WPF or Silverlight?

I want to create a desktop like app, but I'm kind of confused as to which technology to use. It seems Silverlight functions like a desktop app. Which technology is better suited and has is more future proof?
WPF is the framework to go with if you are building a desktop application. Silverlight is more of a web application framework. It all depends on where and how the application is being used.
This Question compares the two.
Desktop apps should be built with WPF. Silverlight has a lot of security restrictions which doesn't make life easier.
Which technology is better suited and has is more future proof?
This depends a LOT on the purpose and goals of your desktop application.
If your application needs to interop with the system in a "non-standard" way, or provide other types of 3rd party interop, WPF will be a superior solution (at least until SL 5's P/Invoke support).
However, if your application is a LOB application, Silverlight (running OOB) has many advantages - especially if you want to take advantage of things like RIA Services (which hasn't been ported to WPF).
WPF has at its disposal the entire .NET framework while Silverlight in an attempt to be lightweight has a part of the framework (plus some really cool things). So, it really depends on the scope and deployment methods. To me it makes more sense to make a Silverlight application a desktop application than to make a WPF application deploy through the web. But again, let the scope dictate. If you're wondering which to learn, the answer is simple - either one as they are similar enough that when you're good at one you'll be okay in the other.
If you're used to WPF, you'll find that Silverlight lacks a bunch of major and minor features like data triggers, FindAncestor, synchronous WebClient requests, and so on. Probably not deal breakers but definitely annoyances.

WPF or Silverlight which one has the upper hand?

I am Really confused by reading some articles about Silverlight. Whether I should concentrate on WPF or Silverlight or Both?.
It's like asking Web or Desktop : Which one has upper hand?
Silverlight (Web) and WPF (Desktop) Both are similar. But both have their separate workplaces.
You cannot have a Windows Calculator, Task Manager or MS Word (please don't mention google docs) applications on web like they are on desktop. And same thing applies for web applications.
So, it depends on what platform you want to work on.
I dont think its difference between Web and Desktop. Silverlight is still pretty limited by platform it can run on and still requires some local runing process, even in the sandbox.
I think difference here is features vs availability. WPF can give you features of whole .NET framework, total acess to users's computer and some features that are not available in SL. SL on the other hand allows you to run your app on some different systems (Windows, Mac and there is limited support for Linux-based systems), distribution is much easier thanks to web deployment and whole application can be part of your web ecosystem.
Iam personaly for WPF, but thanks to this whole web and cloud-hype in the last years, SL is getting much more attention from side of MS and developers in general.
Reading these questions and their answers may give you some insight into this:
Definitive source(s) for the difference between Silverlight and WPF
https://stackoverflow.com/questions/1254937/wpf-vs-silverlight
What is the difference between WPF and Silverlight?
I totally agree with decyclone, it depends on which platform you want to work. If you have prior experience Asp.net/We applications Silverlight is the way whereas if you have worked in WinForms/Windows applications then WPF is the way to go.
But yes most of the concepts in both SL and WPF are similar; so once you have good understanding of those concepts, you work in either without much problem.
If we ignore the platform then WPF is having the upper hand as WPF is kind of superset of SL.
Have a look at this SO question too -
Learn Silverlight or WPF first?

Resources