Has anyone been able to solve the airspace issues when trying to play a flash (swf) movie in a WPF application? I've been able to play the swf file using a WinForms control and a WindowsFormsHost element, and also using the WebBrowser element - but both have the airspace issues.
It depends on exactly what you're trying to do but I've used a transparent overlay window with success.
Track the underlying window's location and update the overlay window's position accordingly.
Ensure that you update the overlay window with minimize/restore/maximize modes.
Set the overlay window's Background to Transparent and the AllowsTransparency to true.
It's a bit of a hassle but not too bad.
Related
In my VSTO projects (Office 2007 / 2010) I would like to use a small popup control (think Tooltip like features; fade animation and mouse interaction).
I would prefer to use WPF. If I were to do this in WPF I would create a custom Popup Control.
In VSTO, as far as I understand it, I must use a WPF window and then have 2 options, either I put this window in a Windows Form Container or I get the Hwnd of my office app and I add this Hwnd to the Owner property of a WPF Window. Am I correct here?
Creating a whole window, animating it on and off the screen etc to look like a ToolTip seems to be overkill.
So my question is how should I do this. I would prefer WPF.
I don't know if this would work but my first thought is to build a very tiny WPF window which is transparent and start it with the Office App. I can then build a Popup Control (which is a child of this tiny window) which I show and not show at a mouse position. Pretty sure a popup can appear outside the bounds of its parent window.
Just wanted to tidy up my own question with what I did. In the VSTO addin project I added a reference to WindowsBase, PresentationFramework and presentation core.
And then I just follow any tutorial or example that adds a WPF Popup. By popup I mean a System.Windows.Controls.Primitives.Popup. For the Placement I used PlacementMode.Absolute and then used a window point to set its position.
This pretty much answers my question. Of course this popup is literally floating above your office window so you will need to make sure that you control it for example if the office window moves, is minimized and the like.
Here's what I am trying to accomplish - To create an MDI application in WPF, which can host child web applications. I am using WPF webbrowser control to render web applications. WPF inherently doesn't seem to support MDI applications, so after a bit of searching, I found this project, which uses UI controls to simulate windows and manages them inside a WPF canvas. This approach seems to work reasonably well until I start adding webbrowser control object as an MDI child.
When I add webbrowser control as an MDI child, it always appears on top of other WPF elements including other MDI child controls (as shown below). From what I understand, webbrowser control always appears on top of any other WPF object except for window (and popup). Assuming that's true, I think I need to use actual WPF window to avoid overlapping issue.
The only solution i can think of right now is to wrap WPF window inside an HwndHost object and then add that as an MDI child. However it appears that a child window cannot have title bar. That means that i need to have a window that has a dummy title bar area (just like actual window title bar) and actual content area (which will show webbrowser control) as shown below (Red border is HwndHost object).
This approach seems to solve the overlapping issue. The next thing i need to try is to let users click on the dummy title bar and drag the MDI window inside the canvas element.
Questions -
Is my understanding about WPF webbrowser control overlapping behavior right? If not, what am i missing?
Is the second approach a step in right direction for accomplishing what i want? If yes, how do i implement the drag behavior for HwndHost?
Is there any other alternate solution i can try?
Note:
Although many consider MDI not an elegant solution, I do not have a choice. (We tried alternate solutions like tabbed windows/dockable
windows, but were not well received)
I am quite new to interop programming, and do not understand the
concepts well. Please correct me if i am misunderstanding things.
Thanks!
I'm a WPF newbie and, unlike WinForms, I have a hard time to setup things in the design window.
My first obstacle is the Image control. After I drag it in the Design window it disappears and there's no way for me to edit its properties (like with the button control for example). The only way to make changes is via the XAML code which isn't very visual and intuitive.
Is there a way to keep editing the Image control in design mode? (example, move it around, select it to view its property panel, etc.)
All you should need to do is give the image control a fixed height and width and it should stay in the designer.
The best thing about the XAML is which separated from code for better re usability like asp.net. It's best you to learn different layouts such as grid, wrappanel, stackpanel etc. Then, you will feel the power of xaml. Else, you can choose the XAML building tools.
Link to refer
I need to create an image of a custom WPF control and save it to file. I do it by this way (http://denisvuyka.wordpress.com/2007/12/03/wpf-diagramming-saving-you-canvas-to-image-xps-document-or-raw-xaml/).
The control contains several panels (ie. StackPanel). When this control is rendered on the form it looks perfectly. But when I render it in memory and save to file all controls in panels are not aligned. They take area that they need only and they doesn't stretch.
When I used WPF 3.5 it worked. This issue appeared after I updated my project to WPF 4.0.
Could anybody explain me what changes in WPF 4.0 cause this behaviour and how I can resolve it?
I'm sure it has been asked before (but couldn't find any resources that solves my problem), I'm creating a Silverlight application where users may install and use in OOB mode, using elevated trust. I want my "windowless window"s background to be transparent so I've set the app to run windowless in OOB mode, and put some margin around my Grid (main grid) along with a drop shadow effect. What I'm trying to achieve is the "zune window" effect: a rectangular main borderless window with drop shadow. I was able to do it in WPF but in Silverlight, I'm getting a white background:
I don't want this white background, and I've double checked that NOTHING has a white background set, but I'm still getting this. How can I get rid of that white border (obviously while keeping the drop shadow effect)?
The short answer is: you can't.
The long answer is: The Window object represents a client window with a solid color background and there is no way to change that color.