WPF Menu Popup Placement - c#

I have a UI design that I created to mimic the way that apps in Win10 look but in Win7 - 8. I created a Menu that drops down and has several buttons in it. When this drops down it's the height of the app itself. If the app happens to go behind the task bar the menu drop down opens up instead of down. Is there a way to change this behavior so that no matter where the app is located on a screen it will open down even if that means behind the taskbar.
Thanks

Related

Place an application's icon into system tray

I'm making a desktop mascot with unity, and I do not want to see the icon appearing on the task bar, I want the icon in the system tray. Is there a way to do this?
PS: This is NOT a windows form (it's a game), so I believe Form.ShowInTaskbar will not work.
I've never programmed in Unity, but I'm assuming you are working in a Windows window. If you make the top level window for the application not appear in the main area of the Taskbar, make the window a "Tool Window" (by setting the WS_EX_TOOLWINDOW extended style on the window), then the window/app will not show up on the taskbar.
I'll leave it to someone how knows enough Unity to tell you how to set that style. Here's a reference to start with (on the Windows side, not the Unity side): Managing Taskbar Buttons

Cycle through open windows in C# using ALT+TAB/ESC and have the current window in focus and forced to be maximized (if already minimized to taskbar)?

I am writing a small application to automatically rotate through open windows on Windows 7/8.1/10 PC's. I have written the majority of the code and it is working well except I cannot figure out or find out what key presses to use to cycle through open applications.
I have tried SendKeys.Send("%{Tab 2}"); but this seems to only actually press the TAB button once as it keeps switching between the same two windows (even though more are open).
I have tried SendKeys.Send("%+{Esc}"); but this doesn't maximize windows that are minimized to the taskbar. It will effectively cycle through each open windows and bring them into focus (as evident by watching the white semi-transparent overlay on the taskbar item) but it won't show them on screen - I'm assuming because they started minimized. Only the maximized ones will show on screen when it's their turn.
Can anyone please assist? I'm sure it's a simple fix of maximizing the window it cycles to but I'm unsure how to implement this.
I haven't included the code of the entire application as I don't think it is relevant. If you do require it please let me know and I will add it.
Many thanks.

WPF : Application Toolbar

I would like to make a login screen for my WPF application, but I want this login screen to be constantly available at a corner of the screen like an application toolbar the application should be hidden and only display when the mouse hovers over a part of the toolbar.
I have searched for solutions, but the only ones I have seen were implemented in c++ for windows applications.
Standard caveats about "always available" apply here of course.
That said, you could easily create a window with WindowStyle="None" (MSDN) and position it wherever you want. This eliminates all window chrome, making it appear that the content is just sitting on the screen. By handling the MouseOver event you could expand to show your additional controls.
Other tricks can be used to have the application live in the tray, etc. For example:
Minimizing Application to system tray using WPF ( Not using NotifyIcon )

Update UI when application runs in backroud

I am developing a banking application for Windows Phone 8.1 RT. For security reason I need to grey out or show an image in my application when it goes background.
It's like when application is running user presses windows button then press and hold back button at that time application's current page is visible. I need to show a image on that view.
When application is running if user press and hold back button at that time also irrespective of page I need to grey my application or show an image.
I have tried changing the opacity of frame in On suspending event it is not reflecting. I have also tried in Window visibility changed event changing the opacity of Window.Content but it's not working too.
Please help me with some pointers on how to achieve this.
There isn't a good way to do this. The app doesn't suspend until several seconds after it has left the screen, so it is too late for the app to change its UI then. Window.Activated would be closer, but is still too late.
ApplicationView.IsScreenCaptureEnabled will prevent capturing a screenshot of the page either in the app or on the task switcher page, but won't prevent the image from showing at all.
The least bad may be to call Application.Current.Exit to close the application completely when deactivated. This is generally a user unfriendly idea, but it will remove the app from the task switcher one it closes (it will probably show up briefly first though).
You can post feature requests on http://wpdev.uservoice.com

Hosting WPF/Surface application within WPF/Surface application

I am trying to create a parent WPF/surface application which will host multiple WPF/surface applications. I am looking for some pointers of how to implement such functionality. Was reading http://msdn.microsoft.com/en-us/library/ms742522.aspx but it talks about hosting Win32 content in WPF and vice versa.
My idea is to have something similar to MDI forms where you have a main form and you can instantiate multiple child forms.
In my case, these would be different applications which will be launched using a config file and loaded within the main application.
Also, since is there a way to ensure that the main window's process memory is not hogged by the child process initiated.
Edit:
The host application will launch different applications based on what user selects. One can say its like an application launcher which are build on WPF/Surface touch SDK. Now once the application is launched the launcher goes in the background(except showing small button to bring it forward again at some point later) and when the user ends the current application launcher comes back again in foreground. The only interaction i feel which is necessary is knowing the launched application is terminated or invoking applications in a limited screen area. If someone has seen the Microsoft surface application launcher, even when the application is launched there are corner buttons which bring the app launcher to foreground.
I would first look at using Microsoft Prism, specifically the Modularity namespace.
Except for the "different applications" part, it sounds like a classic case for MVVM. Are these "different applications" actually separate applications, or could they simply be separate projects within the same application? That may simplify the choice of presentation.
I suppose you could still have a View called "Host" that presents a different app.
Of course, WPF doesn't have the concept of MDI, but you can open multiple, non-modal windows.
It really depends on what you mean by "hosting". Does the main window need to somehow handle and/or interact with the other applications, or is it just a launching pad for other applications?
I followed this approach to solve this problem. The launcher was not hosting the application within itself but would launch a new application and hide itself.
Steps I followed:
The main launcher application will run in Kiosk mode i.e always on top/no option to close by capturing the close event/No instance shown in taskbar/no title bar/killing the explorer.exe/hiding the taskbar.
The launcher populates a horizontal listbox (data templated for UI) which lets occupied main center area of screen and can be scrolled either ways.
When user selected an item on listbox, click/tap event a separate process is launched with launcher window's visibility set to hidden and a small button(basically a window with just a button inside and size set to height/width of button) created on the either corner of the screen with always on top option.
The functionality of button is to minimize the current working application and set visibility of launcher back to visible and setting the focus to this window.
Since the process is launched by launcher, i trap the close event for the launched window to know user ended the application and then again pop up the launcher back.

Categories

Resources