コード例 #1
0
        /// <summary>
        /// Opens the new window based on the given application view model.
        /// </summary>
        /// <param name="newApplicationViewModel">The new application view model.</param>
        private static void OpenNewExperimentWindow(ApplicationViewModel newApplicationViewModel)
        {
            var wrapper = new ApplicationViewModelWrapper(newApplicationViewModel);

            System.Windows.Window window = new TraceLab.UI.WPF.Views.MainWindow(wrapper);
            window.Show();
        }
コード例 #2
0
ファイル: ExperimentViewModel.cs プロジェクト: thbin/TraceLab
        /// <summary>
        /// Extracts all assemblies containing the components and types used in the current experiment and passes
        /// them to the Package Builder.
        /// </summary>
        /// <param name="param">The Application View Model Wrapper.</param>
        private void PackExperimentFunc(object param)
        {
            bool isExperimentSaved = !this.CurrentView.IsModified;

            if (isExperimentSaved == false)
            {
                MessageBoxResult result = MessageBox.Show("To create a package, the experiment needs to be saved first.\nWould you like to proceed?", "Save modified experiment", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (result == MessageBoxResult.Yes)
                {
                    try
                    {
                        isExperimentSaved = ExperimentManager.Save(this.CurrentView.GetExperiment(), this.CurrentView.ExperimentInfo.FilePath);
                    }
                    catch (Exception e)
                    {
                        isExperimentSaved = false;
                        MessageBox.Show("Package building process interrupted. The following error ocurred:\n" + e.Message, "Error while saving experiment", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
            }

            if (isExperimentSaved && param is ApplicationViewModelWrapper)
            {
                ApplicationViewModelWrapper AppVMWrapper = (ApplicationViewModelWrapper)param;

                Experiment originalExperiment = (Experiment)this.TopLevel;

                TraceLab.UI.WPF.Views.PackageBuilder.PackageBuilderMainWindow pkgBuilderWindow =
                    new TraceLab.UI.WPF.Views.PackageBuilder.PackageBuilderMainWindow(originalExperiment, AppVMWrapper.WorkspaceViewModel.SupportedTypes);
                pkgBuilderWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                pkgBuilderWindow.ShowDialog();
            }
        }
コード例 #3
0
        public static void Run(TraceLab.Core.ViewModels.ApplicationViewModel context)
        {
            var wrapper = new ApplicationViewModelWrapper(context);
            var app = new Application();
            Window wind = new MainWindow(wrapper);

            app.Run(wind);
        }
コード例 #4
0
        public StartPageModel(ApplicationViewModelWrapper wrapper)
        {
            this.m_wrapper = wrapper;
            this.m_new     = m_wrapper.New;
            this.m_open    = m_wrapper.Open;

            this.m_recentExperiments = m_wrapper.RecentExperiments;
            this.m_links             = m_wrapper.Links;
            this.m_videos            = m_wrapper.Videos;
        }
コード例 #5
0
        public StartPageModel(ApplicationViewModelWrapper wrapper)
        {
            this.m_wrapper = wrapper;
            this.m_new = m_wrapper.New;
            this.m_open = m_wrapper.Open;

            this.m_recentExperiments = m_wrapper.RecentExperiments;
            this.m_links = m_wrapper.Links;
            this.m_videos = m_wrapper.Videos;
        }
コード例 #6
0
        internal MainWindow(ApplicationViewModelWrapper context)
        {
            InitializeComponent();
            DataContext = context;

            this.Closing += MainWindow_Closing;
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
            DockManager.Loaded += new RoutedEventHandler(DockManager_Loaded);
            DockManager.DeserializationCallback = DockManager_DeserializationHelper;
        }
コード例 #7
0
 /// <summary>
 /// Opens the new window based on the given application view model.
 /// </summary>
 /// <param name="newApplicationViewModel">The new application view model.</param>
 private static void OpenNewExperimentWindow(ApplicationViewModel newApplicationViewModel)
 {
     var wrapper = new ApplicationViewModelWrapper(newApplicationViewModel);
     System.Windows.Window window = new TraceLab.UI.WPF.Views.MainWindow(wrapper);
     window.Show();
 }