These are chat archives for ButchersBoy/Dragablz

21st
Mar 2017
Malte Baden Hansen
@Moulde
Mar 21 2017 07:00
I have a tabViewModel that has a Parent property. This property is updated from the Observable OnChanged event, so that the parent is updated to whatever MainViewModel the tab is dragged to. But when docking/branching the tab in a window, it seems to not run the onchanged event in the observable collection. So I am trying to set the Parent property using the DragablzItem.DragCompleted, but I am having a hard time accessing the actual tabviewmodel from that event. All i can see is a UnderlyingContent that contains the tabViewModel instance, but that property is internal. Is there a way to do this using this event, or am i looking in the wrong place?
Malte Baden Hansen
@Moulde
Mar 21 2017 12:15
I was unable to keep the Parent property of my tabViewModels referenced to the WindowViewmodel, so instead i changed it so that when i want to open a dialog, i go throught the Loaded layout instances using Layout.GetLoadedInstances, and then finds the layoutinstance where my viewmodel is a child. Then i find the window in which the layout instance is located. Then i have the window, which has a datacontext, which has the DialogIdentifier property. Then i use the dialogHost to open the dialog.