Beispiel #1
0
 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);
     }
 }
        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);
        }
Beispiel #3
0
        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);
        }
        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");
        }