Esempio n. 1
0
        void showGuiPreview()
        {
            var waitIndicator = new WaitIndicator();

            waitIndicator.BeginWaiting(Left, Top, ActualWidth, ActualHeight);

            string assemblyDirectory = Path.GetDirectoryName(m_Project.AssemblyOfPreviewedGui);

            if (!string.IsNullOrEmpty(assemblyDirectory))
            {
                Directory.SetCurrentDirectory(assemblyDirectory);
            }

            m_Loader = m_LoaderFactory.Create();

            // Assemblies referenced from XAML through the "pack://application" syntax need to be loaded
            foreach (string assemblyToPreload in m_Project.PreloadedAssemblies)
            {
                m_Loader.PreloadAssembly(System.IO.Path.Combine(assemblyDirectory, assemblyToPreload));
            }

            // Load XAML Dictionaries like "pack://application:,,,/AnyAssembly;component/AnyPath/AnyResourceDictionary.xaml"
            m_Loader.AddMergedDictionary(m_Project.ResourceDictionaryToAdd);

            m_Loader.Load(m_Project.AssemblyOfPreviewedGui, m_Project.TypeOfPreviewedGui);

            var asmTypes = m_Loader.GetLoadedAssemblyTypeNames();

            viewModel.ListOfSelectedAssemblyTypes = new ObservableCollection <string>(asmTypes);

            m_Loader.Show();

            waitIndicator.EndWaiting();
        }
Esempio n. 2
0
        void showGuiPreview()
        {
            var waitIndicator = new WaitIndicator();
            waitIndicator.BeginWaiting(Left, Top, ActualWidth, ActualHeight);

            string assemblyDirectory = Path.GetDirectoryName(m_Project.AssemblyOfPreviewedGui);
            if (!string.IsNullOrEmpty(assemblyDirectory))
                Directory.SetCurrentDirectory(assemblyDirectory);

            m_Loader = m_LoaderFactory.Create();

            // Assemblies referenced from XAML through the "pack://application" syntax need to be loaded
            foreach (string assemblyToPreload in m_Project.PreloadedAssemblies)
            {
                m_Loader.PreloadAssembly(System.IO.Path.Combine(assemblyDirectory, assemblyToPreload));
            }

            // Load XAML Dictionaries like "pack://application:,,,/AnyAssembly;component/AnyPath/AnyResourceDictionary.xaml"
            m_Loader.AddMergedDictionary(m_Project.ResourceDictionaryToAdd);

            m_Loader.Load(m_Project.AssemblyOfPreviewedGui, m_Project.TypeOfPreviewedGui);

            var asmTypes = m_Loader.GetLoadedAssemblyTypeNames();
            viewModel.ListOfSelectedAssemblyTypes = new ObservableCollection<string>(asmTypes);

            m_Loader.Show();

            waitIndicator.EndWaiting();
        }