This project is read-only.
1

Closed

Can't close view from viewModel

description

Refering to the issue, described here.

https://catel.codeplex.com/discussions/453811

In my current project im not able to close the view from my viewmodel.
it worked in my previous project though.

Created a new catel project and just added a button with a command that calls:
CloseViewModel(true);

..and nothing happens, view stays open. No idea whats wrong.
When I click the close button I get follow output in visual studio:
01:48:16:526 => [DEBUG] [Catel.MVVM.ViewModelManager] Unregistering all models of view model 'MainWindowViewModel' (id = '1')
01:48:16:527 => [DEBUG] [Catel.MVVM.ViewModelManager] Unregistered all '0' models of view model 'MainWindowViewModel' (id = '1')
01:48:16:533 => [DEBUG] [Catel.Messaging.MessageMediator] Unregistered '0' handlers for the recipient with tag 'null'
01:48:16:545 => [DEBUG] [Catel.MVVM.ViewModelCommandManager] Unregistering commands on view model 'WPFApplication1.ViewModels.MainWindowViewModel' with unique identifier '1'
01:48:16:546 => [DEBUG] [Catel.MVVM.ViewModelCommandManager] Unregistered commands on view model 'WPFApplication1.ViewModels.MainWindowViewModel' with unique identifier '1'
01:48:16:548 => [DEBUG] [Catel.MVVM.ViewModelCommandManager] Disposing commands on view model 'WPFApplication1.ViewModels.MainWindowViewModel' with unique identifier '1'
01:48:16:549 => [DEBUG] [Catel.MVVM.ViewModelCommandManager] Disposed commands on view model 'WPFApplication1.ViewModels.MainWindowViewModel' with unique identifier '1'
"WPFApplication1.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.resources\v4.0_4.0.0.0_de_31bf3856ad364e35\PresentationFramework.resources.dll" geladen
A first chance exception of type "System.InvalidOperationException" accured in PresentationFramework.dll.
"WPFApplication1.vshost.exe" (Verwaltet (v4.0.30319)): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\mscorlib.resources\v4.0_4.0.0.0_de_b77a5c561934e089\mscorlib.resources.dll" geladen
A first chance exception of type "System.Reflection.TargetInvocationException" occured in mscorlib.dll.
WPFApplication1.vshost.exe Warning: 0 : 01:48:16:682 => [WARNING] [Catel.Windows.Controls.MVVMProviders.Logic.WindowLogic] Failed to set the 'DialogResult' property of window type 'MainWindow'
WPFApplication1.vshost.exe Information: 0 : 01:48:16:684 => [INFO] [Catel.MVVM.ViewModelBase] Closed view model 'WPFApplication1.ViewModels.MainWindowViewModel'
01:48:16:686 => [DEBUG] [Catel.MVVM.ManagedViewModel] Removed view model instance, currently containing '0' instances of type 'WPFApplication1.ViewModels.MainWindowViewModel'

file attachments

Closed Aug 20, 2013 at 7:51 AM by GeertvanHorrik

comments