void RegisterCustomShapes() { using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("XtraDiagram.CreateCustomShapes.CustomShapes.xml")) { var stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", stream, shapeName => shapeName); DiagramToolboxRegistrator.RegisterStencil(stencil); } }
void RegisterContentItemTools() { DiagramStencil stencil = new DiagramStencil("CustomTools", "Content Item Tools"); stencil.RegisterTool(new FactoryItemTool( "Text", () => "Text", diagram => new DiagramContentItem() { CustomStyleId = "formattedTextContentItem" }, new Size(230, 110), true)); stencil.RegisterTool(new FactoryItemTool( "Logo", () => "Logo", diagram => new DiagramContentItem() { CustomStyleId = "devExpressLogoContentItem", }, new Size(230, 80), true)); stencil.RegisterTool(new FactoryItemTool( "Action", () => "Button", diagram => new DiagramContentItem() { CustomStyleId = "buttonContentItem", }, new Size(230, 80), true)); DiagramToolboxRegistrator.RegisterStencil(stencil); }
public MainWindow() { InitializeComponent(); var customContainersStencil = DiagramStencil.Create(MyContainersStencilName, "Custom Containers", containerDescriptions); diagramControl.Stencils = new DiagramStencilCollection(DiagramToolboxRegistrator.Stencils.Concat(new[] { customContainersStencil })); diagramControl.SelectedStencils = new StencilCollection(MyContainersStencilName, BasicShapes.StencilId); }
void InitializeStencils() { DiagramStencil myStencil = new DiagramStencil("CustomStencil", "Custom Stencil"); FactoryItemTool myContainerTool = new FactoryItemTool("Decoder", () => "Decoder", d => CreateDecoderContianer()); myStencil.RegisterTool(myContainerTool); diagram.Stencils = new DiagramStencilCollection(myStencil); diagram.SelectedStencils = new StencilCollection(myStencil.Id); }
void RegisterCustomShapes() { var shapesDictionary = new ResourceDictionary() { Source = new Uri("DiagramResources.xaml", UriKind.RelativeOrAbsolute) }; var stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", shapesDictionary, shapeName => shapeName); DiagramToolboxRegistrator.RegisterStencil(stencil); }
protected override void RegisterCustomToolboxItems() { var dashboardStencil = new DiagramStencil(OfficeStencilId, () => "Office Shapes"); foreach (var tool in GetResourcesTools()) { dashboardStencil.RegisterTool(tool); } DiagramToolboxRegistrator.RegisterStencil(dashboardStencil); }
void InitCustomDiagramShapes() { ResourceDictionary customShapesDictionary = new ResourceDictionary() { Source = new Uri("CustomShapes.xaml", UriKind.Relative) }; var stencil = DiagramStencil.Create("MyShapes", "Custom Shapes", customShapesDictionary, shapeName => shapeName); DiagramToolboxRegistrator.RegisterStencil(stencil); diagramControl.SelectedStencils.Add("MyShapes"); }
public void RegisterShapes() { DiagramControl.ItemTypeRegistrator.Register(typeof(DiagramShapeEx)); var stencil = new DiagramStencil("customShapes", "Custom Shapes"); stencil.RegisterTool(new FactoryItemTool("activeTaskShape", () => "Active Task", diagram => new DiagramShapeEx { Content = "Active Task", Status = Status.Active }, new System.Windows.Size(150, 100), false)); stencil.RegisterTool(new FactoryItemTool("inactiveTaskShape", () => "Inactive Task", diagram => new DiagramShapeEx { Content = "Inactive Task", Status = Status.Inactive }, new System.Windows.Size(150, 100), false)); DiagramToolboxRegistrator.RegisterStencil(stencil); diagramControl1.OptionsBehavior.SelectedStencils = StencilCollection.Parse("customShapes"); }