public void Init(Service service)
 {
     DataContext = contentManagerViewModel = new ContentManagerViewModel(service);
     service.ContentUpdated += (type, name) =>
     {
         RefreshContentList();
         ContentLoader.RemoveResource(name);
         if (isContentReadyForUse)
             Dispatcher.Invoke(
                 new Action(
                     () =>
                         contentManagerViewModel.SelectedContent =
                             new ContentIconAndName(contentManagerViewModel.GetContentTypeIcon(type), name)));
     };
     service.ContentDeleted += name =>
     {
         RefreshContentList();
         ContentLoader.RemoveResource(name);
     };
     service.ProjectChanged += () =>
     {
         isContentReadyForUse = false;
         RefreshContentList();
     };
     service.ContentReady += () =>
     {
         Dispatcher.Invoke(new Action(contentManagerViewModel.ShowStartContent));
         isContentReadyForUse = true;
     };
 }
Exemple #2
0
 public void Init(Service service)
 {
     DataContext             = contentManagerViewModel = new ContentManagerViewModel(service);
     service.ContentUpdated += (type, name) =>
     {
         AddContentToContentList(type, name);
         ContentLoader.RemoveResource(name);
         if (isContentReadyForUse)
         {
             Dispatcher.Invoke(
                 new Action(
                     () =>
                     contentManagerViewModel.SelectedContent =
                         new ContentIconAndName(ContentIconAndName.GetContentTypeIcon(type), name)));
         }
     };
     service.ContentDeleted += name =>
     {
         DeleteContentFromContentList(name);
         ContentLoader.RemoveResource(name);
     };
     service.ProjectChanged += () =>
     {
         isContentReadyForUse = false;
         RefreshContentList();
     };
     service.ContentReady += () =>
     {
         Dispatcher.Invoke(new Action(contentManagerViewModel.ShowStartContent));
         isContentReadyForUse = true;
     };
     contentManagerViewModel.RefreshContentList();
 }