question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows form host showing in Datagrid but not in DialogHost.

See original GitHub issue

When using this DLL IPAddressControl` is made for forms in WPF like

<TextBlock Style="{StaticResource MaterialDesignDisplay1TextBlock}" TextWrapping="Wrap" HorizontalAlignment="Center">Database servers</TextBlock> <WindowsFormsHost Width="120"> <ipBox:IPAddressControl /> </WindowsFormsHost>

It is showing correctly as image

But while the same element , If I am using in Dialoghost it is not showing. ` <Button Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}" Margin="0 20 0 0" Width="140" HorizontalAlignment="Right">Add New Server <Button.CommandParameter> <StackPanel Margin="16"> <TextBlock>Add a new Server</TextBlock>

                    <!--<WindowsFormsHost wpf:HintAssist.Hint="Server IP"   Height="27" Width="100">
                        <ipBox:IPAddressControl x:Name="IPAddress"   />
                    </WindowsFormsHost>-->
                    <StackPanel x:Name="ipStack">
                        <WindowsFormsHost Width="120">
                            <ipBox:IPAddressControl x:Name="IPAddresss"   />

                        </WindowsFormsHost>

                    </StackPanel>
                    <TextBox wpf:HintAssist.Hint="Notes" Style="{StaticResource MaterialDesignTextAreaTextBox}"                             
                       VerticalScrollBarVisibility="Auto"  Margin="0 15 0 0" FontSize="16" Grid.Row="2" MaxLength="500" Width="400"
                        VerticalAlignment="Top" Height="100" AcceptsReturn="True" TextWrapping="Wrap">
                        <TextBox.Text>
                            <Binding Path="Notes" UpdateSourceTrigger="PropertyChanged"> </Binding>
                        </TextBox.Text>
                    </TextBox>



                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
                                <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True"                                            
                                        Command="{Binding AddnewCommand}"> Add </Button>
                                <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" 
                                        Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}">Cancel</Button>
                            </StackPanel>
                        </StackPanel>
                    </Button.CommandParameter>

                </Button>`

image image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jespershcommented, Aug 7, 2019

You’ll need to add the ResourceDictionary inside the DialogHost if it isn’t inside App.xaml.

0reactions
MichelMichelscommented, Dec 24, 2021

See previous comment for fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WindowsFormsHost in WPF Not Displaying Hosted ...
It is used to host an individual Windows Forms control in a WPF view. If you want to get a handle to the...
Read more >
Host a Windows Forms composite control in WPF
This walkthrough steps you through an application that hosts a Windows Forms composite control to perform data entry in a WPF application.
Read more >
Making Sense of the Material Design in XAML Dialog Host
Material Design In XAML Dialog Host: learn about this powerful control that displays info and prompts the user when info is required.
Read more >
C#/WPF - Fixing DialogHost bugs in Material Design in XAML
In this live stream we work on addressing various bugs with the DialogHost control. Material Design In XAML Project: ...
Read more >
Creating Lookup Screens using ASP.NET, XML and JavaScript
Lookup screens are dialog boxes that allow you to pick a value from a list of values. This article tells you how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found