RobinPerris / DarkUI

Dark themed control and docking library for .NET WinForms.
MIT License
837 stars 186 forks source link

how to refresh data in terms of plotview on DockDocument? #27

Closed biotech7 closed 4 years ago

biotech7 commented 4 years ago

hi, @RobinPerris, thanks for your great work first! currently i have a question for help. i added a plotview control on DockDocument. but cannot refresh data on tabbed document(plotview.invalidate() doesn't work) when new date coming in. could you help me how to refresth new data on plotview?

Thanks!

ohhsodead commented 4 years ago

@biotech7 this may seem quite obvious, but have you tried either .Update() or .Refresh() on both of the controls?

biotech7 commented 4 years ago

@ohhsodead, i use plotview.Refresh() and plotview.Update(), don't work. i want to add control plotview on tab "Document 1", not tab "Document 2"( or other tabs), how can i specify tab "Document 1" distinguishing from other tabs and refresh it alone? this issue puzzles me.

RobinPerris commented 4 years ago

If you load up the Examples project and look in Forms/Docking you can see how tabbed content panels should be designed. You can then look at MainForm.cs to see how to initialize and manage instances of these controls.

There is also a writeup in the Wiki here: https://github.com/RobinPerris/DarkUI/wiki/Tabbed-document-interface

There is no PlotView control in the default WinForms library. Is this an external control you added?

biotech7 commented 4 years ago

thanks for your reply. i'll follow your instruction to check the problem. i add plotview control of Oxyplot lib. into dockdocument container. it's not fully compatible with DockDocument mainly at a result of malfunction of refreshing data.

RobinPerris commented 4 years ago

This isn't related to DarkUI - what you're struggling with is using OxyPlot. Check out the documentation here: https://oxyplot.readthedocs.io/en/latest/getting-started/hello-windows-forms.html

I took the OxyPlot WinForms example, pasted it in to the DarkUI examples project and it worked just fine. Here's a video of it working: https://streamable.com/aa79gq

biotech7 commented 4 years ago

@RobinPerris,very appreciated for your verificatin. i can reproduce this example. but my issue is a little different from the example (my datasource from remote server, refreshing method is automatic by calls from other function) . i'll try to figure out it. In conclusion, this maybe is not a bug but a demand for further improvment.

RobinPerris commented 4 years ago

Closing this as it doesn't seem to be a bug with DarkUI itself - feel free to open a new one if you're still having problems.