Airspace issuse and wpfairspace

Source: Internet
Author: User

Airspace issuse and wpfairspace

The airspace problem is caused by the differences between Winform and WPF in the underlying rendering mechanism. In most cases, developers encounter such problems in order to implement irregular forms and carry the Winform control. When the WPF form is set to allow transparency (that is, AllowsTransparency = True), Winform Control will not be displayed. To avoid this problem, many UI frameworks implement irregular forms, the Win32 API is used to implement some special effects of irregular forms, such as transparency and rounded corners. In this way, the AllowsTransparency attribute of the WPF window can be set to FALSE, thus bypassing the airspace issue. However, the development costs for those who have not been familiar with the underlying development of windows are relatively high, and in some special cases, the AllowsTransparency must be set to True. How can this problem be solved?

  • The first method is the most common method on the network. Simply put, it is an embedded form. This method is not described.
  • The second solution is to use a third-party library to solve the airspace problem.

Use third-party libraries to solve airspace problems

Microsoft. DwayneNeed (
Https://microsoftdwayneneed.codeplex.com/
), This library is also written in the project introduction.

Mitigating "airspace" issues in WPF applications.

It may be seen that this database cannot solve the problem of airspace perfectly, and it can only be improved by Microsoft.

Take the powerful WebBrower in Winform as an example to briefly describe how to use it:

  • Create a WPF form project and add Microsoft. DwayneNeed. dll and Microsoft. DwayneNeed. Win32.dll references.
  • Add the xmlns: airspace = "clr-namespace: Microsoft. DwayneNeed. Interop; assembly = Microsoft. DwayneNeed" Statement
<airspace:AirspaceDecorator AirspaceMode="Redirect" IsInputRedirectionEnabled="True" IsOutputRedirectionEnabled="True">    <WindowsFormsHost Name="FormsHost">      <winform:WebBrowser/>    </WindowsFormsHost></airspace:AirspaceDecorator>

The above is an introduction to the Airspace issuse in WPF. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.