AvaloniaUtils / DialogHost.Avalonia

AvaloniaUI control that provides a simple way to display a dialog with information or prompt the user when information is needed
MIT License
270 stars 16 forks source link

Bug when mixing DialogContent and DataTemplates in a DialogHost instance in XAML ? #38

Closed rodrigovaras closed 3 months ago

rodrigovaras commented 1 year ago

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">

.... 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,
SKProCH commented 1 year ago

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?

rodrigovaras commented 1 year ago

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.

SKProCH commented 3 months ago

Closing as stale. If the issue still relevant - feel free to reopen this or create a new one.