This question is locked. New answers and comments are not allowed.
I'm having trouble filling the RadDiagramToolbox (Telerik.Windows.Controls.Diagrams.Extensions.RadDiagramToolbox) with my custom shapes.
I had this working when using the old, externally compiled, RadDiagramToolbox (in the 'Features' solution), but the only output here are the type names (see attached). The custom shapes, which are all pulled from the application's Resources, worked fine with that component.
___________________________________
Xaml
Code:
I had this working when using the old, externally compiled, RadDiagramToolbox (in the 'Features' solution), but the only output here are the type names (see attached). The custom shapes, which are all pulled from the application's Resources, worked fine with that component.
___________________________________
Xaml
<telerik:RadDiagramToolbox x:Name="ToolBox" Title="Gallery" Margin="0 0 -1 -1" Grid.Row="1" Grid.Column="1" d:LayoutOverrides="Height" Width="260" HorizontalAlignment="Right" ItemsSource="{Binding ToolboxItems}" />
Code:
public HierarchicalGalleryItemsCollection _toolboxItems { get; set; } public HierarchicalGalleryItemsCollection ToolboxItems { get { if (_toolboxItems== null) LoadToolbox(); return _toolboxItems; } set { _toolboxItems = value; } }
private void LoadToolbox() { var items = new HierarchicalGalleryItemsCollection(); items.Clear(); var controlList = <list of resource names> var galleryCollection = new Gallery() { Header = "General"}; controlList.ForEach(c => galleryCollection.Items.Add( new GalleryItem(c, new CustomShape() { Name = c, Style = (Style)Application.Current.Resources[c] }))); items.Add(galleryCollection); _toolboxItems = items; }