Hello
I made addin application in c#. I created a window in MVVM pattern so ui is made in XAML file and then attached to DockableToolbar as it was in example:
public class DockToolbar : DockableToolbar, BMG.IGuiDockable { static private DockToolbar instance; private MainWindow mainWindow; public DockToolbar() { this.mainWindow = new MainWindow(); this.mainWindow.VerticalContentAlignment = SW.VerticalAlignment.Center; this.Content = this.mainWindow; this.Title = "MyApp"; this.AttachingToHost += new BMG.AttachingToHostEventHandler(MyApp_AttachingToHost); this.DetachingFromHost += new EventHandler(MyApp_DetachingFromHost); this.Attach(MyApp.Instance, "MyApp"); // Setup AutoOpen after calling Attach() this.AutoOpen = true; this.AutoOpenKeyin = "mdl silentload MyApp,,DEFAULTDOMAIN;MyApp open"; }
Everything is working fine but UI is blank after opening new file
After opening new file :
How can I fix that codebehind? For now i just minimize and maximize Microstation window to refresh that.
I tried UpdateLayout on MsterFileStart event but it doesn't work.
Hi Domain,
Damian Holubowski said:Everything is working fine but UI is blank after opening new file
What "opening new file" means? Does it happen what new session is started and the file is opened, or also when the session is active, workspace remain the same, and another file is opened?
Damian Holubowski said:How can I fix that codebehind?
It's hard to say, when only a fraction of code is shared (but I agree it's probably the most important one for the discussion).
Did you implement properly also IGuiDockable interface?
I would try to remove everything not necessary and to add functionality step by step, from simple WPF dialog to dockable toolbar. At some step, it stops work.
For the first sight it looks like some initialization or refresh event is swallowed or processed incorrectly.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Damian,
I checked WPFDEMO example I assume you used as a template for your code, and there is exactly the same problem.
So I guess it's about to report this issue using Service Request, and also to people like Robert Hook or Mangesh.Shelar who should be able to report it internally to the right developer. Likely it's a bug in DockableToolbar class implementation.
Hi Jan,
Thanks for reply. I tried to use my app without DockableToolbar class, calling plain WPF window and the behavior is the same, so popably this is not straight connected with DockableToolbar but definitively something is wrong on Microstation side.
Damian Holubowski said:calling plain WPF window and the behavior is the same
I do not see this issue, when I tested all examples in WPFDemo in MicroStation CE U16. Only when WPF control is displayed as DockableToolbar content, it's not refreshed when docked. Other classes (DockableWindow, ToolSettings, plain WPF dialog...) work fine.
Damian Holubowski said:but definitively something is wrong on Microstation side.
In my opinion, only DockableToolbar contains this bug, and only when docked.
Jan Šlegr said:In my opinion, only DockableToolbar contains this bug, and only when docked.
Hi all,
FYI The issue is reproducible using the WPFDemo sample from SDK and Bug # 693749 has been filed to address this issue.
Best regards,Artur
Answer Verified By: Robert Hook
Artur Goldsweer said:Bug # 693749 has been filed to address this issue.
Great, thanks for the info :-)