示例#1
0
        public IUiService Create(IModelService modelService, IDiagramService diagramService,
                                 double minZoom, double maxZoom, double initialZoom)
        {
            var diagramViewModel = new RoslynDiagramViewModel(modelService, diagramService,
                                                              _initialIsDescriptionVisible, minZoom, maxZoom, initialZoom);

            return(new ApplicationUiService(_hostUiServices, diagramViewModel));
        }
示例#2
0
        public RoslynUiService(IHostUiServices hostUiServices, RoslynDiagramViewModel diagramViewModel)
            : base(diagramViewModel)
        {
            _hostUiServices   = hostUiServices;
            _diagramViewModel = diagramViewModel;

            _resourceDictionary = ResourceHelpers.GetResourceDictionary(DiagramStylesXaml, Assembly.GetExecutingAssembly());
            _diagramControl     = new DiagramControl(_resourceDictionary)
            {
                DataContext = _diagramViewModel
            };
            Initialize(_resourceDictionary, _diagramControl);

            hostUiServices.HostDiagram(_diagramControl);
        }