disabling Windows phone map control - windows-phone

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.

Related

Possible to make an OS X with a window that blocks a portion screen like the system menu bar?

Is it possible to create a NSWindow that will not only is above all other windows (including other applications) but also able to block windows from going "into" that window. Basically I would like to extend the system's menu bar by having another bar below it, but it stops the user from resizing other windows to occupy that space.
For instance, if the user was to maximize a window, it would only be able to have a height of the screen size minus the system status bar minus my application's window.
I was thinking it may be possible by listening to some sort of window resizing notification and if the user tries to set the frame of that other window to a size that would go inside of my application's window then I would resize the other window, but method seems like such a pain.
I also acknowledge that this may not be possible, but was curious if it is!
Thanks in advance!
It is totally possible to make a window which is above all other windows, just set It's level to NSMainMenuWindowLevel.
But preventing other windows from resizing beyond It, I don't think so.
Even if there is a system API to limit window resizing (I don't think there is), some apps use custom code to control window resizing and would completely ignore the presence of your "special" window. I've seen apps which simply hardcode 22 (the height of the menu bar) when calculating window resizing stuff.

Scroll bars for Excel CustomTaskPane developed using VSTO

I have an add-in, developed using VSTO, that displays a custom task pane in Excel. This custom task pane holds a user control containing tree-view and other controls. I enabled AutoScroll for the user control and can see the traditional windows scroll bar when ever i re-size the control. However, i want the scroll bar to be similar to the scroll bars that exist in Thesaurus CTP in Excel 2013,when the CTP is in floating position and re-sized to smallest size, (i cant post images as i have reputation below 10). can any one provide pointers for this?
Also is there any way to restrict the minimum size of CustomTaskPane ?
Hello Guruteja,
You can handle the Resize event of the Control class to control the size of your form and set the min size programmatically.
It looks like you need to develop a custom control to imitate the built-in one. Or try searching for any third-party Windows Forms controls.

.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).

In Objective-C/Cocoa, are there global events for when mission control is activated or spaces are changed?

I'm currently working on an OSX menubar app that uses a custom status item view and a NSPopover to display content.
I'm trying to get it to dismiss at times that would make sense like when spaces are changed, since the popover doesn't move spaces like a window does, or when mission controller is activated.
Currently, when in mission control, the NSPopover stays on top as shown in this screenshot.
Currently I'm using NSEvent addGlobalMonitorForEventsMatchingMask: with some mouse event masks and that works alright but doesn't cover all needed events.
So, is there a way to detect when major OS events happen like opening mission control, changing spaces etc?
Any help would be greatly appreciated.
You can get notified of space changes by registering for NSWorkspace's NSWorkspaceActiveSpaceDidChangeNotification. There isn't a notification as such for Mission Control, but you might investigate whether NSWorkspaceDidActivateApplicationNotification or other notifications can be used to determine what you need.
HTH

Detect whether a Windows 8 Store App has a touch screen

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;