Tag: wpf

WPF/Silverlight Layout Gotchas

Coming from WinForms or even older technologies like MFC, WPF and Silverlight are a revelation. A consistent framework to layout simple forms, draw graphics, add video and 3D images and animation and styling. All in the same window. Woo! But there some places where WPF and Silverlight behave differently to initial expectations and which can waste a lot of developer time or even put some off entirely from experimenting with them. Interactive Demo Most layouts in WPF use a Grid control. It’s very flexible and has a lot of powerful features. The classic demos for WPF for WinForms developers show…

Read More »

Experiments with Silverlight

So how easy is it to take a WPF project and run it as Silverlight instead? As with so many things – it depends. OK, so the code I converted was fairly trivial and completely unrepresentative but it was interesting to see just how easy it can be, and how frustrating it can be. How things change Basic classes Exception – in .Net – Serializable, in Silverlight – not so much. So simple exception subclasses need conditional code. I wasn’t expecting problems with code quite so trivial. My approach was basically try and compile it and if it broke flip…

Read More »

Improvements in UI

I’ve been playing with WPF. I’ve seen some good talks and demos of quite beautiful user interfaces and wanted to start getting some practical experience. I’ve also read a lot about the MVVM pattern which sounds like it gives a clean, easily understood separation of display and code, reducing those moments when you look at something and have to ask “should this be in the model or the controller/presenter?” So new project. I’m going to write Noughts and Crosses. On a computer. Because no-one’s ever done that before! Ok, so not very original but the point was to give a…

Read More »