Bug when mixing DialogContent and DataTemplates in a DialogHost instance in XAML ?
Pretty sure this was working on previous versions of the nuget package. I moved to 0.7.7 and now i'm seeing a wrong popup when attempting to select the dialog content vs a data template. When using a data template using the 'Show' method then later attempting to select IsOpen shows the previous DataTemplate instead of the DialogContent. Here is the snippet of my XAML: <dialogHostAvalonia:DialogHost x:Name="DialogHost" IsOpen="{Binding CommandError, Converter={x:Static ObjectConverters.IsNotNull}}" Identifier="MainDialogHost" DialogClosingCallback="{Binding DialogClosingHandler}" DialogMargin="16" dialogHostAvalonia:DialogHostStyle.CornerRadius="8"> dialogHostAvalonia:DialogHost.DataTemplates <DataTemplate DataType="vm-iot:DownloadConfigurationModel"> <ContentControl Template="{StaticResource DownloadConfigurationControl}" /> </DataTemplate> <DataTemplate DataType="vm-iot:UploadConfigurationModel"> <ContentControl Template="{StaticResource UploadConfigurationControl}" /> </DataTemplate> <DataTemplate DataType="vm-iot:DownloadLogsModel"> <ContentControl Template="{StaticResource DownloadLogsControl}" /> </DataTemplate> </dialogHostAvalonia:DialogHost.DataTemplates>
<dialogHostAvalonia:DialogHost.DialogContent>
<StackPanel Orientation="Vertical">
.... When the binding trigger the IsOpen it will show a previous DataTenmplate used befaore. If no DataTemplate was used before then the behavior is to show the proper dialog content.
Can anybody confirm if this is a valid bug?
Thanks in advance,
Hello, @rodrigovaras.
I was pretty sure what this is an Avalonia behavior. Can you provide an minimal reproduceable example, cuz i can't really understand order of actions tbh?
Hello, @rodrigovaras.
I was pretty sure what this is an Avalonia behavior. Can you provide an minimal reproduceable example, cuz i can't really understand order of actions tbh?
XAML has defined a DataTemplate and a DialogContent section. I simulate an error during my 'Connect' command which will trigger the 'IsOpen' property. Result is correct the Host show the XAML content of my error description , etc.. So far good, now i use a menu item which trigger by code use the Show method that trigger the proper DataTemplate, i have 3 different ones. So far so good.
Finally i trigger another Connect error which should display my dialogcontent XAML, but it shows the latest XAML form the last DataTemplate.
Closing as stale. If the issue still relevant - feel free to reopen this or create a new one.