I need to write design-time part of my Control.
In the code I need to create new Object (TextColumn) and add it to the Collection (Columns). The changes must be reflected in XAML document. How can I do it?
In WinForms I used IDesignerHost.CreateComponent method.
WinForms
IServiceProvider srvProvider; IDesignerHost host = (IDesignerHost)srvProvider.GetService(typeof(IDesignerHost)); PropertyAxisBar band = (PropertyAxisBar)host.CreateComponent(itemType);
But I cant find any Documentation or Example for WPF.
I explored documentation - WPF Designer Extensibility https://docs.microsoft.com/en-us/previous-versions/bb546938(v=vs.110)?redirectedfrom=MSDN
and Demo project - XAML Designer Extensibility Documents & Samples https://github.com/microsoft/xaml-designer-extensibility
Unfortunately, these sections do not describe how to create objects that reflect changes in a XAML document.
1.4m articles
1.4m replys
5 comments
57.0k users