Windows 8 styled popup window using Prism c# WPF - c#

I'm trying to create a modal popup window using the windows 8 style popup.
If I use the standard prism popup methods as described here :
http://msdn.microsoft.com/en-us/library/ff921081%28v=pandp.40%29.aspx
I only end up getting new windows. What I want is to have a popup that stays in the context of my window. I just can't find anyway of accomplishing this with a modal popup. Has anyone attempted this or knows of a way this can be accomplished?

Although nice, you won't be able to use the PopupWindowAction since inherently it uses a new window. You can, however, manually add an event handler to the event in your ViewModel from the code behind and do your interactivity there.

Related

Hooking Caliburn.Micro WindowManager up within Excel

I have a problem that is similar to that posted here. I have posted before about using Caliburn.Micro in an Excel Document customization where the WPF controls are on an ActionsPane without receiving much help.
I currently have this working by placing the ShellView user control onto the design surface of the ActionsPane inside the ElementHost. Most things work as normal with Caliburn.Micro, however I do not get any Activate or Deactivate events because I haven't got a reference to a Caliburn.Micro WindowManager.
If I create a new window manager and use it to show a window using ShowWindow, then the window appears as a completely separate window (not in the ActionPane) however I do get Activate/Deactivate events.
Is there some way to attach Caliburn.Micro's Window manager to the ActionPane within Excel. I already have a MEF Bootstrapper passing false to BootstrapperBase.
Regards
Alan

WPF application with several windows including a non active: focus issue

I have a .Net 4 application with two windows in WPF 4:
One uses the WS_EX_NOACTIVATE style to prevent gaining focus.
The other is a basic Window.
The "no-activate" window behavior is appropriate as soon as I do not select the basic window (it doesn't gains the focus). But when the basic window is selected, the "no-activate" window can be focused... and gains it when the user clicked on it.
It is as if WPF considered two windows of the same application had the right to give focus even if they are not supposed to.
This behavior does not happen if both windows are WS_EX_NOACTIVATE.
Have you ever been faced with this problem?
I have read this: WPF in Visual Studio 2010 – Part 3 : Focus and Activation, but does not solve it.
Edit: I have been able to get around by using a Popup as a base class for my no-active Window. However, I don't want to have a Popup. Why !? The popup never receives the focus: does someone know why / how ? How can I reproduce this behavior to a Window ?
I try to step into Popup / Window code, but it is not very clear !
Thanks !
Try also giving it the WS_EX_TOOLWINDOW.
http://www.daniweb.com/software-development/csharp/threads/273724/a-form-that-doesnt-steal-focus#
OK. I partially solved the problem.
The Window already got the focus if it is directly selected, but it is not focused when a component of the window is selected.
Just add :
Focusable = false;
to any WPF controls contained in the Window and they will never been focused even if the previous focus is a Window of the same Application.

Attaching WndProc in WPF Page

I am trying tot attaching WndProc in WPF Page, not Window.
I am using this example:
http://blog.andreweichacker.com/2010/02/attaching-to-wndproc-in-wpf/
But it does not work for WPF Page.
Thank you.
That's because wndproc is a Windows concept, and is per window. It knows nothing about WPF pages which are constructs internal to WPF. Window is the only thing with a wndproc.

Leave parent window active when child opens

How can I open a child window and keep the parent window active. I am using Silverlight 5 with the latest version of the toolkit.
I understand that playing with the brushes can help to have the background look normal but the parent window is still disabled.
I am trying to implement a find feature similar to a control F. I want the user to search in a child window and the matches would be displayed on the main display.
Thank you for your help,
ChildWindow is made for modal (disables the parent) use.
It uses a overlay window to make the background appear disabled as you've discovered, however it also marks the Application.Current.RootVisual's IsEnabled to false, which it then restores when the ChildWindow is closed.
This prevents any interaction to the controls of the 'parent' window. The only way around this to make your own style ChildWindow control but leave out this behavior.
FloatableWindow is a codeplex project from Tim Heuer's work, which is a nice quick way to solve your problem. Altho it appears as tho the project hasn't been updated in a while so compatibilty with the latest silverlight version might be in questionable.
DevExpress has a DXDialog control which includes Show and ShowDialog functions for modal and non-modal behavior. I'm sure other silverlight toolkit companies provide similar alternatives, this is just one I'm familar with.
If you don't mind making a custom control you could follow something like Tim Heuer's blog post on the subject to adapt your own control or use a tool like Reflector to reverse engineer the ChildWindow from silverlight itself and remove the parts you don't want.

How to know which control window got focus right now in Modal dialog using Win32 API?

I am trying to do something with the Modal dialog in Win7. To do that I need to know which control window has got focus right now by using Win32 API. If I could know which control is now got focus then I can send message to this window to do some specific task.
Could any one suggest me how should I know which control has got focus right now using win 32?
If you want to know which window has keyboard focus and you're only interested in windows belonging to your own thread use GetFocus.
Finding out which window in the entire system has focus requires a few steps:
GetForegroundWindow
GetWindowThreadProcessId
GetGUIThreadInfo

Categories

Resources