예제 #1
0
 public MainWindow()
 {
     try
     {
         VmcExecuteInstaller vmcExecuteInstaller = new VmcExecuteInstaller(VmcStudioUtil.Application);
         vmcExecuteInstaller.Install();
         MediaCenterUnmanagedLibrary.MediaCenterLibraryUpdated += new EventHandler <MediaCenterLibraryUpdatedEventArgs>(this.MediaCenterLibraryUpdated);
         this.documents = new ObservableCollection <FrameworkElement>();
         this.InitializeComponent();
         VmcStudioApp app = VmcStudioUtil.Application;
         base.DataContext = app;
         DependencyPropertyDescriptor dependencyPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(VmcStudioApp.SelectedDocumentProperty, typeof(VmcStudioApp));
         dependencyPropertyDescriptor.AddValueChanged(app, delegate
         {
             if (app.SelectedDocument != null)
             {
                 FrameworkElement selectedItem = this.documents.First((FrameworkElement o) => o.DataContext == app.SelectedDocument);
                 this.tabs.SelectedItem        = selectedItem;
             }
             else
             {
                 this.tabs.SelectedItem = null;
             }
             this.gamesDropDown.IsEnabled = (app.SelectedDocument is StartMenuDocument);
         });
         app.Documents.CollectionChanged += new NotifyCollectionChangedEventHandler(this.DocumentsCollectionChanged);
         app.Documents.Add(new ThemeSelectionDocument(app));
         app.Documents.Add(new StartMenuDocument(app));
         app.SelectedDocument = app.Documents[0];
         MainWindow.Instance  = this;
     }
     catch (Exception ex)
     {
         String why = ex.Message;
     }
 }
예제 #2
0
 public MainWindow()
 {
     try
     {
         VmcExecuteInstaller vmcExecuteInstaller = new VmcExecuteInstaller(VmcStudioUtil.Application);
         vmcExecuteInstaller.Install();
         MediaCenterUnmanagedLibrary.MediaCenterLibraryUpdated += new EventHandler<MediaCenterLibraryUpdatedEventArgs>(this.MediaCenterLibraryUpdated);
         this.documents = new ObservableCollection<FrameworkElement>();
         this.InitializeComponent();
         VmcStudioApp app = VmcStudioUtil.Application;
         base.DataContext = app;
         DependencyPropertyDescriptor dependencyPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(VmcStudioApp.SelectedDocumentProperty, typeof(VmcStudioApp));
         dependencyPropertyDescriptor.AddValueChanged(app, delegate
         {
             if (app.SelectedDocument != null)
             {
                 FrameworkElement selectedItem = this.documents.First((FrameworkElement o) => o.DataContext == app.SelectedDocument);
                 this.tabs.SelectedItem = selectedItem;
             }
             else
             {
                 this.tabs.SelectedItem = null;
             }
             this.gamesDropDown.IsEnabled = (app.SelectedDocument is StartMenuDocument);
         });
         app.Documents.CollectionChanged += new NotifyCollectionChangedEventHandler(this.DocumentsCollectionChanged);
         app.Documents.Add(new ThemeSelectionDocument(app));
         app.Documents.Add(new StartMenuDocument(app));
         app.SelectedDocument = app.Documents[0];
         MainWindow.Instance = this;
     }
     catch (Exception ex)
     {
         String why = ex.Message;
     }
 }