I am having a problem with embedding webbrowser in WPF application.
As you may know the standard webbrowser is not really a WPF component.
When you embed the control you cannot apply any transforms on it and is displayed on the topmost layer as it is just wrapper for winforms control.
I have to create app with webbrowser included; the app should rotate to face all four edges of the touch capable screen that will be built into the restaurant table.
I've tried Awesomium and CefSharp but touch scrolling works only in winforms components (which is weird cause WPF was designed with touch in mind).
Any ideas? Alternative WPF browser components? The component has to WPF control, be touch responsive and preferably free or cheap.
If it is still relevant, there is a way to make WPF WebBrowser control touch-friendly (IE10+), here is how.
Related
We're developing Windows desktop app with full-screen OpenGL graphics. Now we want to display a bunch of controls over the OpenGL (arrows, buttons, etc.) It turns out it is very difficult to do that.
The majority of tutorials suggest using WindowsFormsHost for OpenGL rendering, and we did so: http://www.codeproject.com/Articles/23736/Creating-OpenGL-Windows-in-WPF
Unfortunately now we cannot draw WPF controls over WindowsFormsHost, there's a lot of discussion about this all over the internet too: WindowsFormsHost is always the most top from WPF element
Render WPF control on top of WindowsFormsHost
There are some hacks that can work around this, but they all seem very dirty.
Is there a proper way to draw OpenGL directly in WPF without messing with Windows Forms? (I just have no idea why you cannot have this in WPF directly).
In short: is there a known solution for drawing UI over OpenGL in WPF applications?
Create a wpf window.
Render your opengl viewport in background.
Get the Snapshot of the opengl viewport and display the image in the WPF.
Transfer all UI Events on the WPF Image to the opengl viewport.
EDIT:
There is a way to host win32 window inside WPF window.
You can refer this video https://www.youtube.com/watch?v=JO4uW8Xb230.
If you are using GLFW for creating win32 window, you just need to use the underlying handle or just cast the window to HWND that WPF needs to host the window.
I have rich client application developed in WPF using DevExpress controls library.
In one of the panels I render some visual elements using OpenTK (OpenGL's wrapper library for .net).
The problem is, OpenGL rendering surface seems to be Top Most within the application. So if I move one panel on to another, OpenGL's control overlays WPF elements:
I'm not sure is it general problem with WPF, or something with DevExpress or OpenTK.
I would like to know, is there anything I can do, to solve this problem?
Edit: I'm using WindowsFormsHost control to put OpenTK's GLControl into WPF UserControl. And I'm using .Net 4.5.
The DockLayoutManager has known limitations when working with WindowsFormsHost. These limitations are general for WPF platform and they are powered by the current implementation of HwndHost (see WPF and Win32 Interoperation MSDN-article for details).
You can try to overcome possible issues with dock panels overlapped by your OpenGL (WinForms) controls, by setting the DockLayoutManager.EnableWin32Compatibility property to true and the DockLayoutManager.FloatingMode property to FloatingMode.Desktop.
I would like to overlay own content above a Direct3D v9 game (made by a third party).
Overlay Interactive Button
Specifically, I would like to overlay a clickable button control, like Steam does, for instance, though I'm attempting a much simpler interface.
Ideally, I would be able to overlay a WPF button or a Windows Form button or whole UserControl, but if that is not possible then creating a functioning button from primitives would suffice as well.
Text Overlay Working with SharpDX
I have a working sample of overlaying text based on the work of Justin Stenning
Namely with the help of SharpDX.Direct3D9.Font DrawText method
How to Overlay a Button or UserControl with SharpDX
I looked through relevant samples in https://github.com/sharpdx/SharpDX-Samples but was not able to find a way to include or draw native controls with SharpDX
Is it possible?
If not, are there any samples of drawing a clickable button from scratch?
Please bear in mind I'm a novice in the DirectX world :)
Your biggest problem isn't going to be getting the controls to render on top of a DX scene; it's going to be getting them to respond to input afterwards. You can probably rig up a way to get the visuals copied to a DX surface, but I have no idea how you would capture input, translate it, and deliver it back to the WPF components. If it's even possible, it's almost certainly more trouble than it's worth.
There are a couple game-oriented Xaml solutions out there that you may want to check out. WPF for Games is a partial C++ implementation of WPF based on Direct3D, and there's also the proprietary Noesis GUI.
I have to play a video in my C# program and I have to make it so that users can't interact with it, since the PC will be set in a public area.
I tried unchecking Enable Control and I also set uiMode to 'none', but CTRL+P (Pause) still works. This makes me think that other hotkeys do as well.
How can I set it so that you can't do anything with the video?
Edit:
I'm using Winforms, because it seems to be easier. I'm not really a C# developer, I have 0 experience and it resembles VB back from school.
In case you are developing WPF application, there is MediaElement you can use. It doesn't have any control for user interaction. Developer has to built it manually using buttons, progress bar, etc in case he need to provide control for user interaction.
And the usage is very straightforward :
<MediaElement Source="path_to_video-file.mp4" />
For reference :
Sample Application in MSDN
http://www.wpf-tutorial.com/audio-video/playing-video/
PS: It turns out that you are developing winform apps instead of WPF. In case this option still interesting for you to try, you can use ElementHost to embed WPF control in winform.
This is one of many tutorials available on net about how to use ElementHost control : http://tech.pro/tutorial/799/wpf-tutorial-using-wpf-in-winforms.
Have you tried putting another transparent WINDOW in front of the media player (area only if needed). While not totally befinner level, that is not exactly super science either.
As WINDOWS can go in front, that should block any interaction with the media player while - due to transparency - still showing the video.
MAybe even a control works (panel with nothing on it), but given that media player is a native control it may be needed to hide it behind a transparent window.
WOuld help to know what UI technology you use.... Winforms or WPF.
I'm writing an app in C# WPF and I'm hoping to implement a similar kind of touch-based horizontal scrolling that's featured prominently in Windows 8.
At the moment I'm using ScrollViewer with content inside it. This works fine as far as the scrolling is concerned, but it creates problems when interacting with controls inside of it (for example, sliders).
With my limited programming knowledge (a month ago the most I'd done was create a mockup in Photoshop :P), I'd assume this was because the touch hits the ScrollViewer first? Is there some way of flipping this around? I would be happy even if you had to hit a white space to be able to scroll, I just need the user to be able to interact with the controls inside easily without accidentally scrolling all over the place ^_^
Unfortunately, I can't just code for Windows 8 as this is specifically for a bunch of touch-enabled Windows 7 machines.
Look for the Metro theme here you might find some usful style here that you can modify and use..
Also you can check this website for information and guidelines on Metro UI on WPF