コード例 #1
0
        protected override void Load(string fileName, bool isReload)
        {
            MetaModel.BaseGlobalDirectory = MetaModelLibraryBase.GetBaseDirectory(fileName);
            LoadVModell(fileName, isReload);

            MetaModel model = this.RootElement as MetaModel;

            model.IsTopMost = true;

            // set locks to imported libraries
            SetLocksToImportedLibraries(model);

            // create model data, store and view model
            ModelData      = new ModelData(model);
            ViewModelStore = new ViewModelStore(ModelData);
            ViewModel      = new MainSurfaceViewModel(ViewModelStore);

            // register known windows
            try
            {
                IUIVisualizerService popupVisualizer = ViewModel.GlobalServiceProvider.Resolve <IUIVisualizerService>();
                popupVisualizer.Register("TargetSelectorForm", typeof(TargetSelectorForm));
                popupVisualizer.Register("CategorizedSelectionPopup", typeof(CategorizedSelectionPopup));
                popupVisualizer.Register("DiagramClassTemplateSelector", typeof(DiagramClassTemplateSelector));
                popupVisualizer.Register("DataTemplatePresetsPopup", typeof(DataTemplatePresetsPopup));
                popupVisualizer.Register("OptimizationControl", typeof(OptimizationControl));
            }
            catch { }
        }
コード例 #2
0
        /// <summary>
        /// Method to invoke when the ShowWindowLogicInViewBase command is executed.
        /// </summary>
        private void OnShowWindowLogicInViewBaseExecute()
        {
            _uiVisualizerService.Unregister(typeof(DemoWindowViewModel));
            _uiVisualizerService.Register(typeof(DemoWindowViewModel), typeof(Views.LogicInViewBase.DemoWindow));

            var typeFactory = TypeFactory.Default;
            var vm          = typeFactory.CreateInstance <DemoWindowViewModel>();

            _uiVisualizerService.ShowDialog(vm);
        }
コード例 #3
0
        public MainWindow()
        {
            //register known windows
            IUIVisualizerService popupVisualizer = ViewModelBase.ServiceProvider.Resolve <IUIVisualizerService>();

            popupVisualizer.Register("PropertyListPopup", typeof(PropertyListPopup));
            popupVisualizer.Register("ReferencedAssembliesPopup", typeof(ReferencedAssembliesPopup));
            popupVisualizer.Register("StringEntryPopup", typeof(StringEntryPopup));
            this.DataContext = new MainWindowViewModel();
            this.InitializeComponent();
        }
コード例 #4
0
        //IUIVisualizerService uiVisualizerService = ServiceLocator.Default.ResolveType<IUIVisualizerService>();

        public MainWindowViewModel(IUIVisualizerService _iUIVisualizerService, IMessageService _imessageService)
        {
            //инициализируем и регистрируем сервисы

            mIUIVisualizerService = _iUIVisualizerService;
            mIUIVisualizerService.Register(typeof(DialogViewModel), typeof(DialogView));

            mIMessageService = _imessageService;
        }
コード例 #5
0
        public MainWindow()
        {
            //register known windows
            IUIVisualizerService popupVisualizer = ViewModelBase.ServiceProvider.Resolve <IUIVisualizerService>();

            popupVisualizer.Register("AddEditOrderPopup", typeof(AddEditOrderPopup));
            this.DataContext = new MainWindowViewModel();
            InitializeComponent();
        }
コード例 #6
0
        /// <summary>
        /// Registers the specified view model and the window type. This way, Catel knowns what
        /// window to show when a specific view model window is requested.
        /// </summary>
        /// <param name="uiVisualizerService">The UI visualizer service.</param>
        /// <param name="viewModelType">Type of the view model.</param>
        /// <param name="windowType">Type of the window.</param>
        /// <param name="throwExceptionIfExists">if set to <c>true</c>, this method will throw an exception when already registered.</param>
        /// <exception cref="System.ArgumentException">viewModelType</exception>
        /// <exception cref="ArgumentException">viewModelType</exception>
        /// <exception cref="ArgumentException">The <paramref name="viewModelType" /> does not implement <see cref="IViewModel" />.</exception>
        public static void Register(this IUIVisualizerService uiVisualizerService, Type viewModelType, Type windowType, bool throwExceptionIfExists = true)
        {
            Argument.IsNotNull("viewModelType", viewModelType);

            if (viewModelType.GetInterface(typeof(IViewModel).FullName, false) == null)
            {
                throw new ArgumentException(Exceptions.ArgumentMustImplementIViewModelInterface, "viewModelType");
            }

            uiVisualizerService.Register(viewModelType.FullName, windowType, throwExceptionIfExists);
        }
コード例 #7
0
        public static new void InitializeDocumentType(IUIVisualizerService uiVisualizerService, IViewModelLocator viewModelLocator)
        {
            viewModelLocator.Register <DialogueView, DialogueViewModel>();
            viewModelLocator.Register <DialogueControl, DialogueViewModel>();

            uiVisualizerService.Register(typeof(DialogueViewModel), typeof(DialogueView), true);
            Splat.Locator.CurrentMutable.Register(() => new NodeView(), typeof(IViewFor <DialogueNode>));
            RodskaApp app = (RodskaApp)RodskaApp.Current;

            app.AddType(GetTypeString(), typeof(Dialogue));
        }
コード例 #8
0
        public MainWindowViewModel(IUIVisualizerService _iUIVisualizerService, IMessageService _imessageService)
        {
            //инициализируем и регистрируем сервисы

            mIUIVisualizerService = _iUIVisualizerService;
            mIUIVisualizerService.Register(typeof(DialogViewModel), typeof(DialogView));

            mIMessageService = _imessageService;

            //наполняем коллекцию слайдами
            mSlidesList = new List <IViewModel>
            {
                new Slide1ViewModel(),
                new Slide2ViewModel()
            };

            //при загрузке окна по умолчанию загружаем первый слайд
            currentSlide = mSlidesList[0];
        }
コード例 #9
0
ファイル: PopupResolver.cs プロジェクト: jackhuclan/cinch-wpf
        public static void ResolvePopupLookups(IEnumerable <Assembly> assembliesToExamine)
        {
            try
            {
                IUIVisualizerService uiVisualizerService =
                    ViewModelRepository.Instance.Resolver.Container.GetExport <IUIVisualizerService>().Value;

                foreach (Assembly ass in assembliesToExamine)
                {
                    foreach (Type type in ass.GetTypes())
                    {
                        foreach (var attrib in type.GetCustomAttributes(typeof(PopupNameToViewLookupKeyMetadataAttribute), true))
                        {
                            PopupNameToViewLookupKeyMetadataAttribute viewMetadataAtt = (PopupNameToViewLookupKeyMetadataAttribute)attrib;
                            uiVisualizerService.Register(viewMetadataAtt.PopupName, viewMetadataAtt.ViewLookupKey);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new InvalidOperationException("PopupResolver is unable to ResolvePopupLookups based on current parameters", ex);
            }
        }
コード例 #10
0
 public MahAppsAboutService(IUIVisualizerService uiVisualizerService, IAboutInfoService aboutInfoService)
     : base(uiVisualizerService, aboutInfoService)
 {
     uiVisualizerService.Register(typeof(AboutViewModel), typeof(MahAppsAboutView));
 }
コード例 #11
0
 private void InitializeWindows()
 {
     _uiVisualizer.Register <BrowserViewModel, BrowserWindow>();
 }