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

Bad interaction between OxyPlot and Dialogs #2529

Closed
yoann-arseneau opened this issue Dec 19, 2021 · 3 comments
Closed

Bad interaction between OxyPlot and Dialogs #2529

yoann-arseneau opened this issue Dec 19, 2021 · 3 comments
Labels
Out of scope Items are outside the scope of this library

Comments

@yoann-arseneau
Copy link

Hi, I encountered an issue where an OxyPlot.PlotView will be blank when shown in a DialogHost's DialogContent. Any insight into what might be causing this interaction would be appreciated.

I illustrate the issue in this repo.

@Keboo Keboo added the Out of scope Items are outside the scope of this library label Dec 20, 2021
@Keboo
Copy link
Member

Keboo commented Dec 20, 2021

Thank you for the nice repo project. It is very helpful. Unfortuently this does not appear to be an issue with this library, and instead appears to be an issue with the OxyPlot library not supporting Popups.
You can confirm this by simply putting the PlotView inside of a Popup control:

<Popup x:Name="MyPopup">
  <Grid Width="500" Height="500">
    <Grid.RowDefinitions>
      <RowDefinition/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>

    <oxy:PlotView Grid.Row="0" Model="{Binding DialogPlot}"/>
    <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
      <Button Command="{Binding SwapCommand}">Swap</Button>
      <Button Command="{x:Static md:DialogHost.CloseDialogCommand}">Close</Button>
    </StackPanel>
  </Grid>
</Popup>

In a button click handler you can simply do the following:

private void Button_Click(object sender, RoutedEventArgs e)
{
    MyPopup.IsOpen = true;
}

I believe the issue is with the OxyPlot library. I suspect it is the same issue here: oxyplot/oxyplot#1796. However, it does not appear there has been a public release of the library since that fix was put in. You might need to compile the library from source, or inquire on that project when the next release will happen.

@Keboo Keboo closed this as completed Dec 20, 2021
@yoann-arseneau
Copy link
Author

Thanks for the prompt and detailed reply! :)

@Erapchu
Copy link
Contributor

Erapchu commented Dec 20, 2021

@yoann-arseneau Keboo was right. As a simple workaround you can use Style="{StaticResource MaterialDesignEmbeddedDialogHost}" for DialogHost
image

Thanks, @Keboo for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Out of scope Items are outside the scope of this library
Projects
None yet
Development

No branches or pull requests

3 participants