Windows Presentation Foundation hosting | Windows Forms | Interoperation behavior |
|---|
Background (System.Windows.Media..::.Brush) | BackColor (System.Drawing..::.Color) | The WindowsFormsHost element sets the BackColor property of the hosted control and the BackgroundImage property of the hosted control. Mapping is performed by using the following rules: If Background is a solid color, it is converted and used to set the BackColor property of the hosted control. The BackColor property is not set on the hosted control, because the hosted control can inherit the value of the BackColor property.
Note:The hosted control does not support transparency. Any color assigned to BackColor must be fully opaque, with an alpha value of 0xFF. Note:You can override this behavior or you can remove the Background property mapping. |
Cursor | Cursor | If the default mapping has not been reassigned, WindowsFormsHost control traverses its ancestor hierarchy until it finds an ancestor with its Cursor property set. This value is translated to the closest corresponding Windows Forms cursor. If the default mapping for the ForceCursor property has not been reassigned, the traversal stops on the first ancestor with ForceCursor set to true. |
FlowDirection (System.Windows..::.FlowDirection) | RightToLeft (System.Windows.Forms..::.RightToLeft) | LeftToRight maps to No. RightToLeft maps to Yes. Inherit is not mapped. FlowDirection..::.RightToLeft maps to RightToLeft..::.Yes. |
FontStyle | Style on the hosted control's System.Drawing..::.Font | The set of WPF properties is translated into a corresponding Font. When one of these properties changes, a new Font is created. For Normal: Italic is disabled. For Italic or Oblique: Italic is enabled. |
FontWeight | Style on the hosted control's System.Drawing..::.Font | The set of WPF properties is translated into a corresponding Font. When one of these properties changes, a new Font is created. For Black, Bold, DemiBold, ExtraBold, Heavy, Medium, SemiBold, or UltraBold: Bold is enabled. For ExtraLight, Light, Normal, Regular, Thin, or UltraLight: Bold is disabled. |
FontFamily FontSize FontStretch FontStyle FontWeight | Font (System.Drawing..::.Font) | The set of WPF properties is translated into a corresponding Font. When one of these properties changes, a new Font is created. The hosted Windows Forms control resizes based on the font size. Font size in WPF is expressed as one ninety-sixth of an inch, and in Windows Forms as one seventy-second of an inch. The corresponding conversion is: Windows Forms font size = WPF font size * 72.0 / 96.0. |
Foreground (System.Windows.Media..::.Brush) | ForeColor (System.Drawing..::.Color) | The Foreground property mapping is performed by using the following rules: |
IsEnabled | Enabled | When IsEnabled is set, WindowsFormsHost element sets the Enabled property on the hosted control. |
Padding | Padding | All four values of the Padding property on the hosted Windows Forms control are set to the same Thickness value. |
Visibility | Visible | Visible maps to Visible = true. The hosted Windows Forms control is visible. Explicitly setting the Visible property on the hosted control to false is not recommended. Collapsed maps to Visible = true or false. The hosted Windows Forms control is not drawn, and its area is collapsed. Hidden: The hosted Windows Forms control occupies space in the layout, but is not visible. In this case, the Visible property is set to true. Explicitly setting the Visible property on the hosted control to false is not recommended.
|