Dynamically changing the look of a WinRT javascript app - user-interface

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?

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.

Related

Can such a UI be created with unmanaged Visual C++ and MFC?

I need to create a shoebox-style native Windows app in C++. A good example of such a UI would be CleanMyPC:
I've tried the various options of the MFC App wizard in Visual Studio 2019 to see what that would give, but it's either document-based (SDI), or too limited (dialog-style). The closest was an empty Win32 app, which just displays a menu bar and a blank window beneath it. At least it matches the Windows style. But that would mean using bare Win32 API, which doesn't seem like a good idea.
Can a UI like in the screenshot be created with MFC? If so, would that be a reasonable approach? Can MFC be effectively used in a non-document-style, non-dialog-style UI like this?
I understand that there's heavy customization of the controls going on in the screenshot; the question is can it be done with MFC?
It looks like the left sidebar and the right details areas could be made of customized list controls. I'll be looking into how a dialog-based sample app arranges the window, so that no document stuff is involved, but without immediate termination on a button click.

How to inspect the UI for xamarin forms

During the xamarin forms development, how to verify if a control is occupying certain pixels in the screen.
(i.e) Like we verify for a web page by going through the developer tools of a browser of the styles each of the element occupies.
Is this possible with Xamarin emulator? To verify if the UI is coming up as expected on the emulator?
There is the Xamarin Inspector if you can afford a Visual Studio Enterprise subscription.
If you can't afford this (about 6000 $ p.a. is quite something), you could use the Appium Inspector (see here). It's very generic and hence not optimized for Xamarin Forms, but it might do the trick, if you're on a budget.
It allows you to inspect the UI elements and verify that they take the space they should. This is approximately how it looks (I think it's an older version):
Anyway, it's somewhat tricky to set up, but if you have set it up, you can use it to run UI-tests, too (that's what it's usually used for).
Bonus: The lowest key variant to verify that your controls take the space they should is simply setting their background color and visually inspect your layout.

Visual Studio windows Tile and cross questions

I've recently (about 3 months ago) started using Visual Studio 2017 Community, v15.6.2. Questions that stump me:
1) How do I get all my windows to be tiled and remain on-screen as I move from one window to the next? At the moment I could have two or more windows in the workspace. As soon as I click on one to work in it, the others disappear. Don't know how to fix it!
2) What is that cross that appears in the center of the workspace when I am busy moving windows around. Cross seems to have arrows and made up of blocks by the looks of it.
3) How do I get the Properties Window to be vertically tabbed on the rhs side of the workspace? i.e. if I click on the Properties tab the Properties window appears, else it is not visible.
Thanks in advance.
By default only one code file is visible in VS. To see multiple code windows at once you can create several tab groups or float document windows outside the IDE. Another option is to use my Task Canvas extension - after you add code files or fragments to the Task Canvas window they are automatically tiled.
For the guide diamond and other window management options please refer to the Customize window layouts in Visual Studio documentation.

Hide visible=false controls in windows forms

I am supporting a large existing windows forms application. It makes use of panels that sit over the other content on forms. The panels have their visible property to false in the designer. At runtime, visible is set to true when appropriate to display the panel.
This system works fine. However, it's hard to maintain the forms that have these panels because the designer shows them even when they should be invisible. Here is an example:
The Panel_archive has Visible set to False. However, it's still showing in the designer. This makes it hard to edit the fields that it hides.
Is it possible to hide this panel (and all its child controls) so that I can edit the stuff behind it? I assume there is a way to do this (at least, in earlier versions of the Visual Studio IDE) as the original developers created the forms like this. However, I can't find a way.

Is Visual Studio a Multiple or Single Document Interface?

In other words, if I want to write a winforms db application with an appearince like VS that has docked panels and also the ability to show/hide forms within some of those panels, how would I structure the interface? How would I have the ability to open several disparate forms at different times (with big data grids on them) while avoiding floating forms and also using memory efficiently? I want to avoid floating windows.
Check out this article to build a VS like interface:
Visual Studio IDE like Dock Container
I haven't tried the component myself but it looks interesting.
Visual Studio is definetly MDI
In the technical sense, Visual Studio is an MDI application whose document windows are anchored by tab navigation.
MDI refers to "multiple document interface," and refers to the fact that there are multiple documents open and visible inside a larger parent window.
In the modern application development realm, typically MDI has been frowned upon -- but that was the "old school" MDI, with the free-floating windows. Those are widely considered to be a usability nightmare.
On the other hand, MDI implemented as tabs inside a parent window is so successful from a UI consideration that even environment which didn't traditionally have MDI (EG, Mac OS) are implementing them.
In order to implement something like this, you can "roll your own," or you can use any of a variety of custom control/API packages which will allow you to easily develop tabbed-interface MDI apps. One of the last things I did with Infragistics NetAdvantage (before moving away from it) was a Visual Studio-inspired app, with docking sidebars, search results as a pane at the bottom, and all the primary data forms as tabbed MDI documents. (Indeed, WinForms is one of the few places Infragistics really shines.)
In terms of memory management, that will be on you. :)
I think technically Visual Studio would be classed as an MDI.
The main form holds disparate controls. Each of these controls can then be docked as required etc. Visual Studio for example has a single control (with multiple tabs) to display the documents you edit. A single control with multiple tabs that holds (eg) Solution Explorer, Properties etc etc.
As a starting point to creating your own IDE style interface I would create a form with 5 panels, one docked to top, one to left, one to right, one bottom and one 'fill'
Thats your starting point. Add splitter bars to allow the panels to be resized. Each panel can then hold a Tab control, and each tab holds a 'MdiBaseControl'
An MdiBaseControl can be whatever you want. So in VS terms you have things like SolutionExplorer, Properties, Breakpoints, FindResults etc etc.
Each MdiBaseControl can be dragged from its current tab and dropped into any of the docked panels (which then adds it to the Tab control as a new tab)
I just noticed that Developer Express have some controls for building IDE-style interfaces.
In both interfaces, multiple forms can be seen at the same time but in MDI, things float freely. In this sense, Visual Studio is a SDI.

Resources