Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rodrigovaras opened this issue Nov 3, 2023 · 2 comments
Labels
needs-repro A reproducible example is needed

Comments

@rodrigovaras
Copy link

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












</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,

@SKProCH
Copy link
Member

SKProCH commented Nov 3, 2023

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?

@SKProCH SKProCH added the needs-repro A reproducible example is needed label Nov 3, 2023
@rodrigovaras
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-repro A reproducible example is needed
Projects
None yet
Development

No branches or pull requests

2 participants