I used to work with WindowsFormsHost (in WindowsFormsIntegration.dll) to host indispensable Windows Forms controls in WPF applications.
Works great in other WPF applications but not with NTTabPage of the demo NinjaTraderAddOnProject as the hosted control is 'alive' but not visible on a NTTabPage.
I've added these references to my add-on:
- System.Windows.Forms
- WindowsFormsIntegration
Here's the complete code of AddOnPage.xaml to host a MaskedTextBox:
<t:NTTabPage x:Class="NinjaTraderAddOnProject.AddOnPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:t="clr-namespace:NinjaTrader.Gui.Tools;assembly=NinjaTrad er.Gui"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Win dows.Forms">
<Grid>
<WindowsFormsHost Width="200" Height="200">
<wf:MaskedTextBox x:Name="mtbDate" Mask="00/00/0000"/>
</WindowsFormsHost>
</Grid>
</t:NTTabPage>
Any ideas why nothing is visible in NT?
Many thanks for any assistance or tips!!!
Comment