Using Popup control in Window 8 - windows-8

Is there any property of pop up , wherein we can dim the window app.
As in metro app there is no Child Window control available , so using
popup in place of it but the problem in popup is when it is open the
user can still interact with other control on window app.
So is there an workaround to make the window app dim when pop is open.

I'm not sure to understand what your trying to do. You can put a Border as first child of the popup which exposes the Background property. So if you specify a not null Background (Transparent for instance) the popup will catch every interactions.

It sounds like you want the MessageDialog class. The popup is meant to be non-modal, letting the user close it by just clicking away from it. The MessageDialog is a regular modal popup that does not let the user interact with the rest of the app when it is displayed.

If you really insist on using the popup control, here is a simple workaround:
Make the popup use all the screen (using a grid or border), then set that background to Black with opacity 0.1 (or any other color you see fit, this is to give a "dim" effect), then inside this popup, place another container with the size and margins that you want to act as your "real" popup.
Because the popup takes the whole screen it will prevent the user from clicking anywhere in the screen.

Related

Pass TappedEvent to a sibling controll in uwp

I have a user control with a bunch of buttons behind a scroll viewer that has a grid with a bunch of rows in it. The first row is empty. The buttons in user control need to respond to tap/click when not obscured by scroll viewer's content. My problem is that the scroll viewer caches the tap event and it is not passed to the user control because it is a sibling to the scroll viewer. I would like to somehow pass/propagate the tap event to the user control to get the buttons working. I can't find a good solution to this issue because there seems to be no RaiseEvent(e) method on UI elements in uwp. Due to specific requirements, the whole page needs to react to scroll and the buttons are required to be behind the scroll viewer content. Does anyone know if it is possible to pass the whole event to another element or somehow allow for both controls to handle it? Thanks in advance.

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

Durandal modal dialog position issue when content added after initial display

I display a modal dialog with a small "please wait" message whilst an Ajax request is underway. Once that request is finished, the result is injected into the content of the modal dialog. If it is significantly larger, obviously the size calculations are thrown off and the "OK" button disappears off the bottom of the screen, requiring a reload to clear the modal!
Is there anything that can be done to resize/reposition the modal dialog after I inject the new content into it, or do I need to change my logic to show a "please wait" and then close it and display the new modal dialog in its completed state?
If you wish to take over the repositioning logic of a Durandal dialog, you would create a custom dialog context. Place your repositioning logic inside of the compositionComplete handler.
Resize, on the other hand, can be handled strictly with CSS. But it can be handled in the compositionComplete handler of the custom dialog context as well.
We have written several custom dialog contexts, and use the approach above to achieve what you are trying to achieve. We have even gone so far as to include special animations in the compositionComplete handler.
Take a look here in Durandal's documentation.
Also, I have uploaded to my public OneDrive a short movie of one of our custom dialog contexts. You can view it here. The slide-out window that pops in front is actually a custom Durandal dialog context.
In Durandal 2.1.0, there will be a method to to reposition the dialog. See:
https://github.com/BlueSpire/Durandal/blob/Version-2.1.0/docs/2.x/Showing-Message-Boxes-And-Modals.html.md#repositioning-dialogs-after-their-contents-have-been-changed

How do I detect when modal title bar is done blinking with WndProc?

I have a VB.net MDI app that contains a modal window (normal window shown as modal). I have a custom title bar button that disappears if the user clicks outside the modal area.
Normally, clicking off a modal will cause the system to beep and then flash the title bar of the modal window.
I want to know how to detect when the flashing is complete (using WndProc if possible) so I can redraw the custom button.
Anyone know how this could be done? Thanks!
It's been a while, but I believe your window should be receiving a WM_NCPAINT message when the frame needs to repaint.
It turns out that I had the WndProc(m) line in the wrong spot.

How can I keep an NSPopUpButton open after the user selects a menu item?

I have an NSPopUpButton providing the NSMenu for a status item with a custom view. The popup button displays a list of links. When the user selects a link from the list, the link is displayed in the user's browser (in the background).
Naturally, the menu closes every time the user selects a link.
I would like to change this: I want the menu to stay open while the user clicks on various links, all of which can be opened in the background. The menu can then go away when the user clicks elsewhere.
How can this be accomplished? Should I subclass NSMenuItem and intercept the mouse clicks somehow? Overlay a transparent NSView on the popped-up menu and, again, intercept the clicks somehow? I make these suggestions blithely, but I would have trouble implementing either of these...pointers to the right methods for override would be appreciated.
Instead of using a menu, one might use a collapsible box.I have seen that in many apps ( also provided by Apple) , so I guess this is the recommended style guide for multiple selections.
The collapsible box expands when you click the disclosure button, and it gives free all items desired - like a tableview with checkboxes.
Views below this box must move down in this case, not to interfere with the box.
Clicking again on the disclosure button will shrink the box back to its origin. The effect is similar to closing a menu.
Usually you should not bend a control too far past it's original intent. Users expect pop up buttons to close after making a selection. I don't think you should, or can, force NSPopUpButtonCell to behave in this way. If you do, you'll be subclassing and modifying the control so heavily that it might change/break with a future version of Mac OS X. You'd also have to worry about the usability problem of users thinking the menu will close after making a selection.
You might consider writing you're own subclass of NSView to work like the menu button you're describing. After the user clicks on the button. You'll want to create a new NSWindow, with no border by using NSBorderlessWindowMask as the style mask. The content view of that window should be another custom view of yours that you implement the menu selection in.