I recently wrote a blog post series on how to share your code between Silverlight and WPF.
With the announcements of Windows 8 at the //BUILD/ conference and the new Windows Runtime (WinRT) which can be built against using C# and XAML I thought it appropriate to start a new series on how to make your existing Silverlight/WPF code run on WinRT. I'm mostly writing this as notes to myself and hope you will also find them useful. Personally I've already found a lot of issues with porting code over. Not that there are significant changes, but the documentation is very limited at this point, and the gotchas enough to make you waste a lot of time on resolving this. Hopefully this will act as a resource to get it working for you as well. Keep an eye on this post. I'll post new links as I go along learning new things about WinRT.
Generally what I have found is that with respect to XAML WinRT is more compatible to Silverlight than WPF, so expect it easier to use your Silverlight knowledge, and don't try and use WPF XAML features at this point. Things like DataTriggers etc. are not supported, and for the most part, the UI related methods in code are more similar to Silverlight than .NET 4 (note however that non-UI code is closer to the "original" .NET, since this is essentially the same CLR and compiler used).
I won't go into too much detail about what this means for Silverlight and WPF. There's plenty of blogs and newssites that has their (over?)reactions described in detail. This series will really just focus on how to take your existing code and get it running on WinRT.
Click to select a topic below:
- WinRT vs. Silverlight - Part 1 - XML Namespace
- WinRT vs. Silverlight - Part 2 - Code Namespace
- WinRT vs. Silverlight - Part 3 - Dependency Properties
- WinRT vs. Silverlight - Part 4 - Dispatcher
- WinRT vs. Silverlight - Part 5 - Defining default style template
- WinRT vs. Silverlight - Part 6 - Using Tasks
- WinRT vs. Silverlight - Part 7 - Making WebRequests
- WinRT vs. Silverlight - Part 8 - What other people are blogging
- Coming… WinRT vs. Silverlight - Part 9 - File IO
- Coming… WinRT vs. Silverlight - Part 10 – Various CTP bugs…