I am developing an application where I need to drag and drop a browser in my wp7 screen.So can any body tel me how can we drag and drop a web browser co开发者_StackOverflowntrol in a wp7 screen Code Examples will do good to me Thank You
Just declare a web browser control in XAML. Designer drag-drop functionality is not the best approach if you are arranging controls on any container, other then Canvas.
Usage would be like this;
<StackPanel>
<WebBrowser .../>
</StackPanel>
If you are talking about allowing the user to be able to drag the control within the running app then you can't do this with the control directly and still allow touch manipulation of the content. You could do this by putting a transparent control over the top of the WebBrowser and making that draggable and duplicating the movements of this transparent control to update the WebBrowser's position.
Such behaviour in an app would likely be very unusual and I'd recommend testing such interaction with users thoroughly and also exploring other ways of achieving the same result.
The easiest way to handle drag and drop in the Web Browser control is to handle the Navigate event. You can also capture drop operations inside of the the actual HTML document using window.ondrop
but if you need to capture full filenames the Navigate
event on the control in the .NET host application is your best bet.
For more detail on how this work take a look at this blog post: https://weblog.west-wind.com/posts/2017/Mar/10/Dragging-and-Dropping-Images-and-Files-into-the-Web-Browser-Control
精彩评论