Bill Reiss is a Windows Platform Development MVP and a Senior Consultant for AgileThought

Archive for July, 2015

This is pretty cool. One of the great new features of Visual Studio 2015 for XAML apps is that you can see the XAML Visual Tree, drill into pieces of it, and do other cool tricks. Think Snoop for WPF or XAML Spy for most XAML based technologies, but now it’s built in to Visual Studio and Blend.

What’s even more interesting is that you can attach to other XAML apps, even if they aren’t yours, including apps that are shipped as part of Windows 10. Some of these are tightly integrated into the shell, but they are still using XAML and the same tools available to any Windows 10 app developer. Want to see how they implemented their UI? It’s a nice peek into their design process.

Ok so first you will need to have the Visual Studio 2015 RTM and Windows 10 SDK RTM. You will also need Windows 10, hopefully this is obvious.

Bring up the Settings dialog in Windows 10. It will look something like this:

image

Now run Visual Studio and Debug->Attach to Process. You will see two processes associated with Settings, one is ApplicationFrameHost.exe with a title of Settings. This isn’t what you want.

image

Instead pick the actual settings app process, called SystemSettings.exe

image

Now if you go to Debug->Windows->Live Visual Tree you should be able to see the XAML Visual Tree of the Settings app.

image

It should look something like this:

image

See that first button in the toolbar? That will highlight whatever you hover over so you can easily drill into it. Select that and then bring the Settings app to the foreground. Now when you hover over elements you should see a red box:

image

If you click on this box, you should see that element selected in the Live Visual Tree pane:

image

I actually thought this was was surprising, because they used a Grid as the container. I really thought it was going to be the new RelativePanel, because of the alignment changes that happen when the settings app goes into “narrow” mode. Maybe this app was written before that was available. You can also right click and show properties in the Live Properties Explorer.

If you are writing a Windows 10 UWP app, why not go and see how other apps are doing it using the new Live Visual Tree functionality in Visual Studio 2015. Enjoy!

I am very excited about the advances that XAML has made in the Windows 10 Universal Windows Platform (UWP) and I think a lot of that has to do with the Windows Shell team and the Office team embracing XAML for building their apps. The Windows Shell team especially is so focused on performance when it comes to fluidity of animations, CPU pressure, and memory pressure. The fact that a ton of UI in the Windows 10 desktop is using XAML is a testament to how far it has come, and clearly the Windows Shell team was very demanding, and that makes it better for everyone. I don’t even know how pervasive XAML is in Windows 10, but I have heard it is used for the Start Menu, Action Center, and the Date/Time popup, and I can see first hand that it is used for the Settings dialog, the Edge browser, the Store app, Xbox app, and a lot more.

This is quite a departure from when Windows 8 was launching and Steven Sinofsky and Julie Larson-Green were on stage and told everyone to use WinJS to build your apps, and the Store app, Bing apps, and many others were using WinJS. This came on the heels of the death of Silverlight, and XAML was DOA, much to the chagrin of C# and .NET developers feeling like they were being left behind. Many of the people on the stage back then are gone, including Steven Sinofsky and Jensen Harris, and others have changed positions such as Dean Hachamovitch and Julie Larson-Green. The new regime seems much more XAML friendly, which isn’t a big surprise since Terry Myerson is running the show and he was in charge of Windows Phone which primarily used XAML as its app platform.

Disclaimer: This next part is based on things that some of the presenters said at the BUILD conference, and I have heard none of it first hand one on one, so I take them at their word, and I apologize if I get it wrong.

One of the big complaints the internal teams had about XAML was that data binding was slow and memory intensive. XAML data binding uses Reflection at run time, which is very flexible but has some overhead. So the internal teams went back to the Windows SDK team and asked for help. At first they thought their recommendation might be to tell them to not use data binding, and wire everything up by hand (back to the standard operating procedures of the Windows Forms days). They finally came up with a better idea. To remove the overhead of Reflection, both from a performance and memory perspective, they came up with a way to move a lot of that overhead to compile time, using code generation. With this, compiled bindings were born. The performance benefits of using code to wire up data mapping, and the productivity benefits of data binding. Fortunately we all get the benefits, and these compiled bindings are now the preferred way to do data binding in Windows 10 UWP apps. I sincerely hope we see these in WPF too in the near future.

Another complaint was about the rigidity of Grid and StackPanel layout, and especially when it comes to responsive design. The solution to this one came from the Android layout system, and the RelativePanel was born. Instead of manipulating grid columns and rows and similar properties, now the location of elements can be defined by their relation to other elements, and this is so much easier to understand and use.

Additionally for responsive design (Microsoft calls it Adaptive UI), the very powerful and flexible (but sometimes very verbose) Visual State system of XAML has been streamlined and tailored to responsive design needs. Now you can easily trigger on screen size and use Setters to respond appropriately. New built in controls like the SplitView also help make it easier to make a UI that will work across multiple form factors.

In conclusion, if XAML is now good enough for the internal Microsoft teams, I am excited to see what we as app developers can make with it. It’s a new day for XAML and the future seems bright in Windows 10.

So you want to be a game developer. There are a few good options of a starting point these days, a lot more than not too long ago where you would be writing most of your own game code and libraries. I presented about Construct2 and Unity2D yesterday at Tampa Code Camp, and Joe Healy contributed a few minutes about GameMaker. Joe and I will do this session together again at Code Impact in Jacksonville August 22 and will provide some other game related sessions as well. Here are the demo projects, demo script, and slides from yesterday’s presentation:

http://1drv.ms/1OgqMeF

I had the pleasure of presenting a new session for me at the Tampa Code Camp yesterday focusing on getting started with the Universal Windows Platform (UWP) for Windows 10. I will be presenting this same session again next month at Code Impact http://www.codeimpact .org in Jacksonville, Florida. I hope to see you there, it’s a free event.

The demo script, sample projects, and slides are available here: http://1drv.ms/1OgqrJ8