How to bind a custom ToolPalette class #953
Answered
by
tortmayr
rileydanejohnston
asked this question in
General
-
Hello, |
Beta Was this translation helpful? Give feedback.
Answered by
tortmayr
Mar 13, 2023
Replies: 1 comment
-
Hi @rileydanejohnston, const toolPaletteModule = new ContainerModule((bind, _unbind, isBound, rebind) => {
bind(ToolPalette).toSelf().inSingletonScope();
bind(TYPES.IUIExtension).toService(ToolPalette);
configureActionHandler({ bind, isBound }, EnableToolPaletteAction.KIND, ToolPalette);
configureActionHandler({ bind, isBound }, EnableDefaultToolsAction.KIND, ToolPalette);
}); If you want to use your custom implementation you simply have to const taskListDiagramModule = new ContainerModule((bind, unbind, isBound, rebind) => {
// ...
rebind(ToolPalette).to(MyCustomToolPalette).inSingletonScope();
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tortmayr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @rileydanejohnston,
the
ToolPalette
is originally bound in thetoolPaletteModule
:If you want to use your custom implementation you simply have to
rebind
theToolPalette
in one of your DI modules: