Jaime Rodriguez On Windows Store apps, Windows Phone, HTML and XAML
In part 2 of the series, I explained the different target scenarios for Silverlight and Windows Presentation Foundation (WPF).
I think at MIX09, we could have emphasized a bit more strongly our Microsoft Client Continuum. We demonstrated it a lot, but maybe did not take time to explain it, or explicitly call it, so I wonder if every one knows about it externally?
The “Microsoft Client Continuum” is our mission to empower you to create the Best User Experiences across all your customer’s touch points.
Today, you can reach customers on a web application (RIA), on Windows, on Surface, on Mobile devices, etc. On part 2 of this series, I explained that one single run-time is likely not flexible enough to address the conflicting requirements (size vs. features, or full-trust vs. sandboxed) from all scenarios; if you want to provide the absolutely best experience across multiple touch points, you will likely end up at least compiling the application twice or having small optimizations for each touch point; this is where the Microsoft Client Continuum offers some significant advantages over other solutions.
The client continuum uses .NET as the single skill, single toolset needed to create immersive client applications.
The continuum facilitates great User Experiences with tools that empower both designers and developers; these tools share a common declarative languages to represent UI and interactions.
The continuum thrives on reuse: skills reuse, tools reuse, and code reuse.
At MIX09, on the Silverlight and WPF front, we demonstrated the continuum a lot:
There were plenty other demonstrations of the continuum in action, and there are plenty more to come. One part that I really enjoyed at MIX was talking to a lot of customers, and partners, who are writing apps that span across the continuum.
For those wondering about the choice between WPF and Silverlight, keep the continuum in mind and rest assured you are not making the wrong decision with either technology.
A few disclaimers on status today and future for the Continuum:
Closing the series: I think MIX09 was a great conference! The features and products announced are very exciting. Microsoft demonstrated strong innovation and adoption on the RIA space, and a strong commitment to User Experience and designer tools. Because MIX09 is a web conference, we shared our web message and this likely confused attendees on our commitment for WPF; the reality is that we are equally committed to WPF and Silverlight, because we need both technologies to deliver on our Client Continuum.
In between all the positive feedback at MIX, there was a lingering question that I read a lot on twits, blog posts, and heard at the Q&A from some sessions and I think we missed it during our planning; I felt it is one of those “we can not see the forest cause the trees are on the way” mistakes. Do you know what the question is??
Yes, it is “With Silverlight out of the browser, is WPF dead?” ..
Here is my personal take as a person who spends a lot of time with both of these teams and with customers using the technologies ( very often at the same time):
WPF and Silverlight address different scenarios and though they look alike, it is unlikely that in the short-term, one replaces the other.
The long answer is that the scenarios each technology addresses are different enough that they have conflictive requirements. I see the choice between these two platforms as a trade-off between:
Size vs. Features Full-trust (with native interop) vs. Secured or Sandboxed
Expanding even further:
Silverlight addresses our RIA needs. A good Rich Internet Application (RIA)run-time needs to be:
WPF addresses our Windows (desktop) application needs. A good desktop application needs to be:
Once you look at the above, it is easy to grasp why today, we do need multiple technologies to address both scenarios. Any one that tells you otherwise is heavily short changing you in one of these two scenarios (usually the desktop).
We do need to acknowledge that RIAs need stickiness, and off-line launching, and that is why Silverlight Out Of Browser was created, I call this scenario the “off-line RIA”; and it is very, very different from the “full-trust desktop app”.
Three more reasons to explain why WPF will be around for a long while:
Inside Microsoft adoption is also strong; we see our business platform – the Dynamics team- using it; we have consumer apps like LifeCam and SongSmith, we have office apps like Semblio, our internal IT teams are using it, and our own development division is betting heavily on WPF to create Visual Studio 2010 and Expression Blend. Announcement: Starting next Tuesday (seems like a good day for recurrent series) I will try to start a new “blog series” similar to Tim Sneath’s “Great WPF applications” series; I am not as eloquent as Tim, but I am happy to keep you on the loop on some of the great WPF apps out there. I don’t think we do enough of sharing those successes(again, trees blocking the forest).
In closing, WPF will be around a while. One size does not fit all, today.
The story on the WPF and Silverlight convergence is actually much better than this post discusses because here I aimed at explaining the different scenarios each addresses; stay tuned for Part 3 to discuss the synergies amongst Silverlight and WPF.
I am finally caught up with my family and work stuff , so I want to share my belated recap and my lessons learned from observing and talking to people at MIX09. Since it is a lot, I partitioned it into three posts:
Part1: Anything that inspired or excited me. Part2: What we could have done (or messaged) better; future for our desktop client. Part3: Our mission on the client space: The Microsoft Client Continuum. Part 1: The good (or great)!
IMO, this was the best MIX to date. Microsoft was finally able to demonstrate and deliver the vision we have been thriving for in the last few years:
My favorite features announced through out the conference:
Don’t get me wrong, I was psyched about a lot more features than I mention above, but I had to pick a few top ones. If you want the list of other features that really excited me:
OK. that is a very high level of all the “Good stuff” .. I do have to give a “Thank You!” shout to the audience and partners that attended. For me and lots of other Microsoft folks, a huge part of MIX are the hallway and meals or party conversations. It is great to hear what we are doing right, wrong, and what we should do next. I also have to throw a shout to the Deborah Adler keynote slot. What an inspiring story.
Stay tuned for part 2 and part 3 in the series!
At MIX last week, we announced that Silverlight 3 supports effects, written in HLSL 2.0 ..
If you remember from this previous post, we have a codeplex WPF library with 20+ effects and greater number of transition effects. Charles Bissonette, in the Blend team ported the library to Silverlight, and we have now merged it into codeplex.
The effects included in this first release are: BandedSwirl, Bloom, BrightExtract, ColorKeyAlpha, ColorTone, ContrastAdjust, DirectionalBlur, Embossed, Gloom, GrowablePoissonDiskEffect, InvertColor, LightStreak, Magnify, Monochrome, Pinch, Pixelate, Ripple, Sharpen, SmoothMagnify, Swirl, Tone, Toon, and ZoomBlur
The transition effects include: BandedSwirl, Blings, Blood, CircleReveal, CircleStretch, CircularBlur, CloudReveral, Cloudy, Crumble, Dissolve, DropFade, Fade, LeastBright, LineReveal, MostBright, PixelateIn, PixelateOut, Pixelate, RadialBlur, RadialWiggle, RandomCircleReveal, Ripple, Rotate, Saturate, Shrink, SlideIn, SmoothSwirl, Swirl, Water, Wave.
If you have Silverlight 3 and want to see the library in action, click here, or in the image below.
To play with the sample app:
My favorite is the transitions.
If you do not have Silverlight 3, Adam Kinney and I recorded an impromptu video for you to see watch the demo with out needing to update your bits to SL3).
Geeking it out (aka the details):
The source is in codeplex. Packaging will likely change. Right now it is WPF project with SL project linking to the WPF files (the way I keep it in source control) but I think for easier download, it will become separate zips and I can duplicate the files just for releases (source can still be single shared file). Please check the pre-requisites in codeplex, you will need latest DirectX SDK, .NET 3.5 SP1 ( or VS 2008 SP1), the Shader Effect build task from WPF Futures and of course SL3 and SL3 tools if you want to run the SL bits.
More effects pictures:
Pinch + Inverted colors. Embossed
Enjoy, please report bugs/issues if needed.
You know the drill: raw unformatted, Q&A from our internal discussions.
Subject: RE: ListBox Binding to IList
When I bind with my own IList/IEnumerable/INotifyCollectionChanged object, I see WPF wrapping it in a collection view of some sort. When I create the collection view myself and give it to WPF, it seems not to wrap it in another collection view. Can you tell me (or point me to code) what’s the magic recipe for determining whether-or-not something gets wrapped in a collection view?
Answer:
Everything that is not already a collection view gets wrapped in a collection view. The basic rule is: IBindingList gets wrapped by BindingListCollectionView IList gets wrapped by ListCollectionView IEnumerable gets wrapped by EnumerableCollectionView.
EnumerableCollectionView is an internal class that takes a snapshot of the underlying IEnumerable, so yes, it enumerates everything. You can avoid this by exposing IList. ListCollectionView only enumerates everything if it has to, usually because you applied sorting, filtering, or grouping.
Hi, We are working on using RenderCapability.Tier in Visual Studio as a way to limit visual candy when being run on a low end machine or over a remote connection. My question is, what happens with this property in edge cases, such as a machine having two graphics cards with different capabilities? Does WPF use the capabilities of the lowest card to set the value? Does the value update dynamically if I move my window from a monitor on one card to a monitor on the other?
Answer: It’s the lowest of all the cards. Dragging your window from one monitor to another shouldn’t trigger a tier-changed event, nor should the result of your tier-query change.
Answer: The extra mem copy was required because on Vista with WDDM you can create a shared surface and give the D3DImage that, and WPF will read from the shared surface directly. On XP there are no shared surfaces so WPF has to copy your D3D device’s surface’s bits to its own D3D device’s surface.
I have a simple need of remembering the window placement (size, location etc) on the exit of my WPF app and setting the same on the next start of my app. Looks like this involves calling unmanaged APIs using PInvoke as explained in the article at http://msdn.microsoft.com/en-us/library/aa972163.aspx. This seemed little strange for a simple need of mine. I’m just wondering if there is a better alternative (without use of PInvoke) to satisfy my need?
Answer: Window.RestoreBounds combined with WindowState is your friend.
I would really like to create a seamless browser-hosted experience, so I went down the ‘web service’ middle tier path as Matt suggested below. Unfortunately, now I’m receiving this SecurityException when attempting to connect to the web service:
System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
The action that failed was: Demand The type of the first permission that failed was: System.Net.WebPermission The Zone of the assembly that failed was: MyComputer It looks as though WebPermission is not allowed for partial trust xbaps either. Are there any known workarounds for this limitation? Is silverlight my only option if I don’t want a client app and I don’t want to force users to install a certificate?
Answer: An XBAP is given WebPermission to its site of origin. Your exception is likely due to a mismatch between the XBAP’s launching URL (it’s the host:port part that matters) and the URL you are trying to access the web service at.
Subject: DrawingImage w/ DynamicResource does not refresh properly when in App.xaml
DrawingImage in app.xaml… refers to brush in app.xaml via DynamicResource … When I update the Brush in App.xaml { by loading different skin } my image does not pick up the new brush… This works fine when these two resources are in Window1.xaml … I know that App.xaml freezes the resources , but I checked and the brush is frozen… that is OK, I am not updating it, I am replacing it.. The Drawing Image says it is not frozen..
Answer: This is a bug. I can’t find anything similar in the bug database; <>, please open a new bug for this. The bug arises when you have two application resources X and Y (i.e. declared in your App.xaml), both of the Freezables, and X contains a dynamic reference to Y. Also, your main tree contains dynamic references to X (but not to Y, except indirectly through X). If you change Y, say by replacing it, the main tree is notified but nothing happens, since there are no references to Y.
Subject: How RenderOptions.CacheHint/CacheInvalidationThresholdMaximum/Minimum works?
I’m working on a project which uses a lot of ImageBrush in the controls. Recently, we found by setting RednerOptions.CacheHint to Cache, and setting CacheInvalidationThresholdMaximum/Minimum can improve the performance, I think this improvement is caused by caching the images. But I want to understand the how these 3 properties works in the code. Can some expert explain this to us?
Answer: RenderOptions.CacheHint helped ImageBrushes? Hmm… maybe. ImageBrushes are already cached but it may cause us to skip resampling the original bitmap. It’s meant for brushes with intermediate surfaces (DrawingBrush and VisualBrush) because if you don’t set any caching hints the contents will be updated every time we render the brush.
The idea is you set CacheHint to Cache to tell us to try to avoid updating the brush. Now if you scaled the brush way up, it could look terrible and if you scale it down it could look bad as well. So min/max thresholds are relative scales to the initial size of the brush that tell us when to update things again. For example, if you set ThresholdMinimum to .5 and the brush size halves, we’ll update the brush and cache the new result.
I recently updated and organized my blog subscriptions. Here is a list (and opml) of all the WPF blogs that I subscribe to. Please let me know if I missed yours! Also, don't let me fall too far behind on keeping it up-to-date.
Gracias!
Catching up on my blog reading, I see two great development frameworks recently posted in Codeplex. Both aim to build clean, testable, loosely coupled WPF applications with separated concerns.
I am really looking forward to diving into these and to see where the community takes them!