'How I can use WinForm user control in WPF Windows

We have a usercontrol (i.e UserControlWinForm) in WinForm which is used inside a different Windows forms, now we want to bind the usercontrol (i.e. UserControlWinForm) to WPF.

We have used a DockPanel in WPF and we want to bind the UserControlWinForm to this DockPanel.

<Window x:Class="Prana.Rebalancer.RebalancerNew.Views.UserControl1"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:igWPF="http://schemas.infragistics.com/xaml/wpf"                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                        xmlns:local="clr-namespace:Prana.Rebalancer.RebalancerNew.Views"
                        mc:Ignorable="d"
                        d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <StackPanel Height="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <DockPanel  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" LastChildFill="True">
                <igWPF:XamDockManager x:Name="docManager" Margin="1,0,1,0" BorderBrush="Black">
                    <igWPF:XamDockManager.Panes>
                        <igWPF:SplitPane igWPF:XamDockManager.InitialLocation="DockedBottom">
                            <igWPF:ContentPane x:Name="ComplianceAlertsBottomDock" Header="  Compliance Alerts  ">
                                <!--Want to use WinForm User Control here-->
                            </igWPF:ContentPane>
                        </igWPF:SplitPane>
                    </igWPF:XamDockManager.Panes>
                </igWPF:XamDockManager>
            </DockPanel>
        </StackPanel>
    </Grid>
</Window>



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source