What does InitLayout do? #360
Replies: 3 comments
-
Its responsible for initialising the state e.g. setting the Factory, Onwer, Context etc. property for all dockable objects: Dock/src/Dock.Model/FactoryBase.Init.cs Line 12 in 2e0d2fb its required to do before using any functionality of Dock and also after loading dock model using serialization. |
Beta Was this translation helpful? Give feedback.
-
If you are using Dock from Xaml only it can be done automatically if you set InitializeLayout=true |
Beta Was this translation helpful? Give feedback.
-
You can see how its used from code Dock/samples/DockMvvmSample/ViewModels/MainWindowViewModel.cs Lines 30 to 33 in 2e0d2fb |
Beta Was this translation helpful? Give feedback.
-
Hi. I know this might not be the desired place to publish this question, but couldn't find any other forum.
What is the responsibility of
public override void InitLayout(IDockable layout)
method? In my code I don't have anything written there, yet it still works fine.I would really appreciate if you could improve documentation of these methods. At least on example projects as comments, like what this line does and what is the responsibility.
I am rather new to Avalonia, and I'm required to write an application with docking layout, that is why little bit of explanation can go a long way.
Beta Was this translation helpful? Give feedback.
All reactions