Should i learn wpf or silverlight




















WPF on the left, as the best way to write managed code applications for Windows 7. Stuck trying to diagnose connectivity or performance issues? Learn how to quickly get to the root cause of traffic and network problems. Join a community of over , senior developers. View an example. You need to Register an InfoQ account or Login or login to post comments.

But there's so much more behind being registered. Your message is awaiting moderation. Thank you for participating in the discussion. Hi Vic, this post is addressed to the. NET community and it discusses. Of course, there are other solutions out there like the one you mentioned. Abel, Implicitly tucked into your post is the hand-on-brain mind control suggestion that converging Silverlight and WPF removes confusion.

WPF is in my experience too big for its own britches. One of the former WPF employees, who now works at Google, referred to it as "too big to reimplement", suggesting nobody would ever even want to copy WPF. Silverlight, in my experience, is much lighter and more object-oriented.

WPF, on the other hand, is a mixture of object-orientation and "the architect's kitchen sink". It just leads to really brittle design and applications crashing or going into an inconsistent state on null pointer exceptions when resources can't be found. Microsoft could not even re-implement WPF from scratch, if they tried. It is an accident, carried through to perfection.

Most of what I want from WPF is access to milcore and the use of retained mode graphics and more featureful hardware accelerated rendering. Some indications are that MS is not afraid to deprecate dumb ideas, like BitmapEffects.

This should not be their first rodeo in WPF or Silverlight. If you put a young cowboy on a bustin' bronco, you'll be depending on the clowns to save you. I've told people in the past this: If you expect me to provide you with a flow chart on when to choose Silverlight or WPF, you are out of your mind, please quit IT.

Do not depend on some stupid flow chart. If you are confused about what technology to use, it is because you lack experience. Your project will be late, due to lack of experience.

And stop asking for a flow chart that will decide your fate for you. Learn More. Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:. Yes, WPF is magnificent, and it may be that I'm all wet about this, but I believe in my gut that Silverlight changes everything. There was no doubt then and there is no doubt today that Silverlight is the most important development platform for Microsoft since.

In a nutshell, here is why. I don't understand where its limitations are. With most platforms I do: you can do this, but you can't do that. Net and WinForms and, well really everything until now. With Silverlight, I don't see the boundaries yet.

Silverlight has already leaped off the desktop onto phones, and I don't see any reason for it to stop there. Yes, it is true, it is bound by the browser, but I see that less as a jail cell than as a tank in which Silverlight will be riding over lots of terrain it must be very late, I should go to bed.

In any case, for now, learning Silverlight is a gas, there is a lot of material on the Silverlight. Enjoy, good luck and the dirty little secret is you'll be fine whichever you choose. It's all just software. But as Silverlight is a subset of WPF if you go in too deep and try to switch to writing Silverlight applications, you'll be scratching your heads looking for that "tag" you learned to love in WPF but is not available in Silverlight.

Silverlight in WPF differs at the features level, not just some missing controls or animations. Take the WPF triggers mechanism for example, is not available fully in Silverlight. So learning the smaller subset first, you can extend that knowledge to the full set later, but if you started at the full set and gets addicted to some of the niceties available, you'll have trouble down the line when someone asks you to port your designed-utilizing-WPF apps to Silverlight.

Much more resources are available for WPF than Silverlight, such as books, blogs, and msdn documentation. You don't have to worry about re-learning to do things correctly because of lacks of features in SL. Silverlight is a stripped down version of WPF so it should have fewer things to learn inside.

If you just want to learn for yourself no app in the close future I'd pick Silverlight because it would be less to assimilate. Still, Silverlight is pretty much a moving target, much more than WPF, so you'll have to keep up with some changes from time to time the joys of being an early adopter :. WPF has lots more stuff that you will probably want to use at some point but I would wait for the needs to arise first.

Every industry expert I've heard on podcasts, blogs and interviews recommend learning Silverlight first and then gradually moving to WPF which is a huge UI framework. Silverlight is light and allows you to work on smaller subset of controls and features such that you get your head around this new UI building paradigm based on,. There are cases where it doesn't make sense or isn't possible to work around platform differences, such as when there is no common solution that would work in both WPF and Silverlight.

When this happens, there are a couple of strategies to consider. For anything but small and isolated platform differences, I would recommend building platform-specific services. But for small platform differences, you could consider either conditional compilation or partial classes. The simplest thing to do to accommodate for different platform capabilities is to use conditional compilation. This seems very handy, but a method or class can quickly become unreadable with this approach.

We've found that you should use the if pre-compiler directive only to sporadically change a single line of code. Because readability really suffers, I don't recommend using this technique for anything but very simple cases like this. Another technique you could employ is the usage of partial classes. Using this technique, you can create classes that are mostly shared, but differ in one or two small methods. This technique can be very useful for adjusting small implementation changes between WPF and Silverlight.

I find partial classes to be particularly useful in the area of exceptions. In the. NET Framework, it's often recommended to make your exceptions serializable. However, Silverlight doesn't support the [Serializable] attribute. Using partial classes, you can reuse most of the exception code, but you can apply the [Serializable] attribute only on the.

NET Framework variant of the code as shown in Figure 6. Unfortunately, partial classes do suffer from discoverability and readability issues. It's not immediately clear in which file your functionality resides. A class should have a single responsibility and be named to reflect that single responsibility. If you find that a class does something in one way in Silverlight and another in WPF, it's not following the single-responsibility pattern.

Extracting the platform-specific code into services with a descriptive name is usually a better solution. Because Visual Studio was never designed to accommodate multi-targeting, you will likely run into some quirks that are caused by the approach. None of them are very serious, but it helps to know what they are.

Visual Studio knows that a linked file can be placed in different types of projects. So, depending on whether you open the linked file from WPF or Silverlight, it will adapt the IntelliSense accordingly. It's often possible that you use a language construct that is available in only one of the platforms.

You will encounter build errors when compiling your solution because your code is invalid for one of the platforms. Depending on whether you opened the file from WPF or Silverlight will determine whether you will see the red squiggly. But once you grow accustomed to the fact that a change in one project can break its linked project, you'll quickly know where to look.

Project references are also interesting. Project Linker doesn't automatically add references. We looked into this while building the tool, but there were too many edge cases to make this reliable. For example, the binaries for Silverlight have different names than the binaries for WPF. Lastly, you can link almost any type of file, such as resource files. However, you should make sure that the properties, such as the compilation options, are the same between both projects.

Many of our customers absolutely love Prism. Even if your application doesn't need the composite capabilities that Prism offers, it can still benefit tremendously from the flexible architecture that Prism promotes. The ability to easily multi-target your application is just one of those benefits—and it's a really nice one! You can learn more about Prism online. He is also a scuba diver, a kung fu master, and a metal guitarist.

Check out the noise he makes at erwinvandervalk. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.

Contents Exit focus mode. Creating a Silverlight Version of Prism Even though we felt that multi-targeting would be a valuable capability for our customers, we also had a somewhat selfish reason for creating it.

Creating Project Linker After our spiking phase, we agreed that the approach of linking files was working, although it was quite tedious and error-prone. Figure 1 Using the Project Linker to Link Files Between Projects Because you might want to have control over which files to link, we implemented a simple naming convention.

Test-Driven Development on Silverlight Another area in which I've personally found multi-targeting to be handy is for doing test-driven development in Silverlight.

Architecting Your Application for Multi-Targeting While building the Silverlight version of the Prism library, the Stock Trader Reference Implementation, and QuickStarts, we learned some valuable best practices regarding multi-targeting.

Identifying What Can Easily be Multi-Targeted Before you can architect your solution to support multi-targeting, it's important to know what can and cannot easily be multi-targeted. For example: Presentation logic. This is the logic that responds to user actions and controls which data to pass to the visual elements.



0コメント

  • 1000 / 1000