bassystem.blogg.se

Caliburn windowmanager
Caliburn windowmanager






caliburn windowmanager

If you need a modeless form, this code can be used: _windowManager.ShowWindowAsync(IoC.Get()) You can set the desired value in the ViewModel using: Tr圜lose(true) // for OK The DialogResult will be returned as bool?. ShowDialogAsync will show a viewmodel as a modal dialog form. Return _windowManager.ShowDialogAsync(IoC.Get())

caliburn windowmanager

Now, using the Caliburn.Micro naming conventions, a method can be created that is invoked when the menu item named “About” is clicked: public Task About() public ShellViewModel(IWindowManager windowManager) The container we created in a previous section will handle this, while creating the ShellViewModel. Then adapt the constructor for the ShellViewModel to import the IWindowManager interface. To support this an interface with a WindowManager is needed in the ShellViewModelįirst, declare a readonly class variable in ShellViewModel.cs: private readonly IWindowManager _windowManager In this part we will hook up the About dialog to the ShellViewModel. To use Dialog Forms is slightly more complicated. In a previous part we have seen how to invoke user controls. Add the About Dialog Form to the ShellViewModelĬontents Previous Add the Dialog Form to the ShellViewModel








Caliburn windowmanager