public MainViewModel() { Messenger.Default.Register <string>(this, "Object_DropInMainArchiverField", (path) => { if (System.IO.Path.GetExtension(path) == ".rar" || System.IO.Path.GetExtension(path) == ".7z") { System.Windows.MessageBox.Show("Поддерживаемый формат разархивации - zip"); return; } ArchivationProgressWindow archivationProgressWindow = new ArchivationProgressWindow(); archivationProgressWindow.Show(); archiveManager.HandleObject(path, new Progress <ProgressInfo>(info => archivationProgressWindow.ChangeProgress(info))); }); Messenger.Default.Register <string>(this, "Object_DropInFileExplorer", (path) => { AddNewFilesOrDirectories(path); }); Messenger.Default.Register <System.Windows.Controls.TreeViewItem>(this, "TreeViewItem_Expanded", (item) => { FileSystemElementViewModel element = (FileSystemElementViewModel)item.Header; if (!element.Element.IsFile) { foreach (var subElement in element.SubFileSystemElements) { if (fileManager.AddSubElements(subElement.Element)) { subElement.InitializeChildren(); } } } else { Process.Start(element.Element.Info.FullName); } }); Messenger.Default.Register <object>(this, "Theme_Changed", (obj) => { ClearField.Execute(obj); }); }