Detect whether a Windows 8 Store App has a touch screen - windows-8

There are certain elements of Win 8 Store App UI that change based on whether the user has a touch screen. For example, a ScrollViewer, when rendered on a non-touch screen shows a vertical scrollbar. On a touch screen, the scrollbar is hidden.
I would like to tailor my application UI, adding extra controls, for non-touch screen users. Does anyone know if it is possible to detect whether a user has a touch screen?

You can use the Windows.Devices.Input namespace to detect various capabilities (touch, keyboard, mouse, etc.). For example, the TouchCapabilities class has a TouchPresent property you could check to see if there's a digitizer available.
Take a look at the Input: Device capabilities sample to see them in action.

If you are using HTML/JS you can query it like this
var touchCapabilities = new Windows.Devices.Input.TouchCapabilities();
var isTouchCapable = touchCapabilities.touchPresent;

Related

What is the recommended pattern for progress indicators when waiting for data in Windows UWP apps?

Let's say I have an app built like the Microsoft weather app.
On launch of app I need to download the forecast from the internet. While waiting to do so I also need to display a progress indicator. Which of the following (if any) is recommended?
Render the page fully with navigation controls (hamburger side menu) as well as page content (but without values since they are data bound). Then overlay a modal control like a popup with a progress indicator inside and a cancel button.
Render only the application root shell with the progress indicator inside (no other content, or navigation controls like hamburger menu are visible). Then once the task is complete, navigate to the home page with content.
Render the home page with content and navigation controls, but hide only the content (with visibility = collapsed) and show a progress indicator in its place. Once data is downloaded hide the progress indicator, and show the content.
I don't know which one of these I'm supposed to use. Is there a recommended way to do this?
Or is there a better way I didn't think of?
There is no one perfect answer for this question but I will try to explain the most common solution. None of points above is good or bad. It is better to concentrate on the user experience.
Render fully page with navigation controls and display loading popup is not really bad idea - user see the whole page with progress ring for instance and has chance to cancel it. But remmber that if data is not loaded or user abort pulling it there will be empty content in the app (if this is first time when user launched the app).
One of the best solutions for scenario you wrote is to use extended Splash Screen. Once you app is launched first Splash Screen is displayed and when you extend it, you can add progress ring to indicate that data is being retrieved.
This is very elegant way to present to the user.
Please see below guidline how to do it:
UWP Extended splash screen

.Net Form Layout - create Chat UI like facebook or google hangouts

I want to create an application and chatting is involved. I am currently struggling to format existing controls or to create a control with the following conditions:
a container is docked to the main form's bottom
inside of that container, a button can be used to toggle a chat
component (e.g. text edit) to become either visible or invisible
if visible, the chat component is aligned with the button that was
pressed but does not force a resize on the container of the button
So basically I want to achieve a facebook or google hangouts like chat layout in vb.net that can also scale dynamically according to the current window size. Nevertheless it should always stick to the bottom.
Please keep in mind that this question is not about making the chat work but only the layout/design problem I am facing.
My current approach is the following:
FlowLayoutPanel docked to bottom with buttons
RichEdit as placeholders to simulate the chat component
My current layout
Is there an easier way to do what I want to do?
Set the anchors to the bottom of the page/panel.
On the designer, click the control you want to edit, find the Anchor property and change it to bottom (and left/right/top, whatever you'd like).

Flipview without rubber band effect at edge in Windows Phone 8.1

I am developing an app, which has 3 screens in first page as flipview items. Two screens has gridview & last screen contains camera. I want to develop nearly same UI as 6snap from Rudy Huyn.
In that it has camera in middle & two gridview (data view) at the ends. It doesn't have elastic band effect while swiping from one screen to another & it seems he has used flipview. I have chose flipview because it has selection change event & I can dispose camera resources efficiently. If my UI control choice is wrong let me know. I have tried to play manipulation events of flipviewitem but it doesn't work as expected. Any one out there who can guide me to develop the same flipview as 6snap.
Please check out my answer here:
ScrollViewer: Disable Snap (elastic band effect)
Maybe you will need to implement a different logic when to disable, and when to enable ManipulationMode, but it is possible

disabling Windows phone map control

My quesiton is: i have a windows phone 8 app - it has a Map Control on a page that shows the user's position.
We want to allow the user to disable the map control so it looks greyed out and disbaled and doesnt update (to save bandwith etc)
What would be the best way of doing this?
I would simply draw a control with semitransparent background on top of the map. thus all touch events would be stuck in the control, but the map would be visible under it still.

Windows 8 metro UI: what is a new place for tray notification icons?

Before windows 8, if application want to non-intrusively inform user that something happens, it displays tray icon, maybe animated. For example, if e-mail application finds a new e-mail, it displays a new tray icon (outlook) or animate it's own icon in tray (all other e-mail clients).
With new Windows 8 Metro UI it's a new screen with tiles that supposed to be a main thing user will use to launch and switch apps. Where is no tray area in this mode, but many other things - charms area, something like status area that displays clock and battery usage etc.
According to Microsoft Metro UI design guides - what is the new place for poor e-mail app notification icon?
I think what you want is a notification. There are three kinds of notifications: a tile update, a badge update on the tile or a "toast" in the upper right corner of the screen (when in another application). The various options for these types of notifications are listed here.
The new place to let someone know your app has updated information is the tile itself.
These are called "Live Tiles" because they're intended to be dynamic, and change as new data becomes available.
http://www.winsupersite.com/article/windows8/windows-8-feature-focus-tiles-143175