private void DiagramVM_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Theme") { if (cacheTheme != null) { cacheTheme.PropertyChanged -= DiagramTheme_PropertyChanged; cacheTheme = null; } if ((StencilView as Grid).Children.Count > 0) { var stencil = (StencilView as Grid).Children[0]; cacheTheme = DiagramVM.Theme; if (cacheTheme != null) { if (stencil is IStencilTheme) { (stencil as IStencilTheme).Theme = Activator.CreateInstance(cacheTheme.GetType()) as DiagramTheme; } cacheTheme.PropertyChanged += DiagramTheme_PropertyChanged; } } } }
public Editor( IControlHostService controlHostService, ICommandService commandService, IContextRegistry contextRegistry, IDocumentRegistry documentRegistry, IDocumentService documentService, PrototypeLister prototypeLister, SchemaLoader schemaLoader, DiagramTheme diagramTheme) { m_controlHostService = controlHostService; m_commandService = commandService; m_contextRegistry = contextRegistry; m_documentRegistry = documentRegistry; m_documentService = documentService; m_prototypeLister = prototypeLister; m_schemaLoader = schemaLoader; m_theme = new D2dDiagramTheme(); m_fsmRenderer = new D2dDigraphRenderer <State, Transition>(m_theme); string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\FsmEditor\\data"); EditorInfo.InitialDirectory = initialDirectory; }
public Editor( IControlHostService controlHostService, ICommandService commandService, IContextRegistry contextRegistry, IDocumentRegistry documentRegistry, IDocumentService documentService, PrototypeLister prototypeLister, SchemaLoader schemaLoader, DiagramTheme diagramTheme) { m_controlHostService = controlHostService; m_commandService = commandService; m_contextRegistry = contextRegistry; m_documentRegistry = documentRegistry; m_documentService = documentService; m_prototypeLister = prototypeLister; m_schemaLoader = schemaLoader; m_theme = new D2dDiagramTheme(); m_fsmRenderer = new D2dDigraphRenderer<State, Transition>(m_theme); string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\FsmEditor\\data"); EditorInfo.InitialDirectory = initialDirectory; }
public ModulePlugin( IPaletteService paletteService, SchemaLoader schemaLoader, DiagramTheme diagramTheme) { m_paletteService = paletteService; m_schemaLoader = schemaLoader; m_diagramTheme = diagramTheme; }
/// <summary> /// This method is invoked when the design ribbon gallery item is loaded. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void DesignRibbonGalleryItem_Loaded(object sender, RoutedEventArgs e) { if (this.Name.Equals("Custom1_ThemeRibbon")) { } this.Theme = Application.Current.Resources[this.ThemeName] as DiagramTheme; this.ContentTemplate = Application.Current.Resources["ribbonItemTemplate"] as DataTemplate; }
/// <summary> /// This method is invoked when the design ribbon gallery item is loaded. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The e. /// </param> private void DesignRibbonGalleryItem_Loaded(object sender, RoutedEventArgs e) { if (this.Name.Equals("Custom1_ThemeRibbon")) { } ResourceDictionary resourceDictionary = new ResourceDictionary() { Source = new System.Uri(@"/syncfusion.diagrambuilder.wpf;component/View/DiagramThemeResources.xaml", System.UriKind.RelativeOrAbsolute) }; this.Theme = resourceDictionary[this.ThemeName] as DiagramTheme; this.ContentTemplate = resourceDictionary["ribbonItemTemplate"] as DataTemplate; }
private void Diagramcontrol_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Theme") { if (cacheTheme != null) { cacheTheme.PropertyChanged -= DiagramTheme_PropertyChanged; cacheTheme = null; } if (((SfDiagram)sender).Theme != null) { cacheTheme = ((SfDiagram)sender).Theme; stencil.DiagramTheme = Activator.CreateInstance(cacheTheme.GetType()) as DiagramTheme; cacheTheme.PropertyChanged += DiagramTheme_PropertyChanged; } } }
protected override void OnClosing(CancelEventArgs e) { if (cacheTheme != null) { cacheTheme.PropertyChanged -= DiagramTheme_PropertyChanged; cacheTheme = null; } if (this.stencil != null) { (this.stencil.SymbolSource as SymbolCollection).Clear(); this.stencil.DataContext = null; this.stencil = null; } if (this.diagramRibbon != null) { this.diagramRibbon.Tabs = null; this.diagramRibbon.DataContext = null; this.diagramRibbon = null; } if (this.diagramcontrol != null) { if (diagramcontrol.Info is IGraphInfo) { (diagramcontrol.Info as IGraphInfo).ViewPortChangedEvent -= FlowDiagram_ViewPortChangedEvent; } diagramcontrol.PropertyChanged -= Diagramcontrol_PropertyChanged; (diagramcontrol.Connectors as ConnectorCollection).Clear(); (diagramcontrol.Nodes as NodeCollection).Clear(); this.diagramcontrol = null; } GC.SuppressFinalize(this); this.DataContext = null; base.OnClosing(e); }
/// <summary> /// Constructor</summary> /// <param name="theme">Diagram rendering theme</param> public AnnotationAdapter(DiagramTheme theme) { m_theme = theme; m_theme.Redraw += theme_Redraw; }
/// <summary> /// Disposes resources</summary> /// <param name="disposing">If true, then Dispose() called this method and managed resources should /// be released in addition to unmanaged resources. If false, then the finalizer called this method /// and no managed objects should be called and only unmanaged resources should be released.</param> protected override void Dispose(bool disposing) { Theme = null; base.Dispose(disposing); }
/// <summary> /// Constructor</summary> /// <param name="theme">Theme for rendering statechart</param> public StatechartRenderer(DiagramTheme theme) { Theme = theme; UpdateToTheme(); }
/// <summary> /// Constructor</summary> /// <param name="theme">Diagram theme for node</param> public DigraphRenderer(DiagramTheme theme) { Theme = theme; }
/// <summary> /// Constructor</summary> /// <param name="theme">Diagram theme for rendering graph</param> public CircuitRenderer(DiagramTheme theme) { Theme = theme; SetPinSpacing(); }
/// <summary> /// Constructor</summary> /// <param name="theme">Diagram theme</param> public CoordinateAxisAdapter(DiagramTheme theme) { m_theme = theme; }