Question

You know when you create a web app, you can hit F12 from your browser and be able to edit things such as style sheet, remove dom elements etc. on the fly.

This makes for a quick turn around when developing a UI. A real time saver!

Otherwise there's a lot of compile, deploy and clicking click to get to the area you wanted to test. And if the area you're testing is at the end of the workflow, the pain is that much more. I find doing this to be frustratingly time consuming when all you want to do is just change the font size to make it look "better".

Is there any tool similar to that in WinRT environment? Is this just the nature of Mobile App development or is there something out there (regardless of platform) that allows you to edit the UI on the fly?

Was it helpful?

Solution

Yes, you have several options available to you.

First, Blend for Visual Studio--which is installed with Visual Studio Express for Windows--is a great styling tool. It shares the same project structure with VS, so you can have both running at the same time. In VS, in fact, right-click a project in Solution Explorer, select Open in Blend, and there you are.

Blend actually loads the app and executes the JS code, so all dynamically-created elements are also in place. It has an Interactive Mode as well that lets you go into the running app, navigate and set state as you want, then exit that mode and work on styling. For more, I have a video in my book (first edition | second edition preview) that shows the basics of Blend--you can specifically go here and check out Videos 2-2 and 5-3 from the second edition). Chapter 2 gives a little intro in the text as well.

The other two options are in Visual Studio itself.

First, when an app it running there's a command Debug > Refresh Windows Apps (F4) that will reload the HTML and CSS without restarting the app. I use this to reload changes for exactly the reasons you mention. This same command is on the toolbar just to the right of the pause/stop/restart buttons.

Second, a running app will have a DOM Explorer pane in the debugger. If you don't see it, use the Debug > Windows > DOM Explorer command to open it. In that pane you can navigate the DOM tree (like you can in Blend's Live DOM pane) and locate the elements you care about, or you can use the leftmost button in the DOM Explorer to go select and element directly in the app.

On the right side of the DOM explorer you then have tabs for Styles, Trace, Computed, Layout, and Events. You can make changes directly in the Styles pane and they're applied immediately. I use this all the time, in fact, to try out things.

I have a 2 minute video in my book for this as well, see here. Some docs are on http://msdn.microsoft.com/en-us/windows/apps/hh696632.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top