We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to add images to Diagram control from ViewModel in MVVM

Hi,

How to add custom image to diagram control and I want to remove default filters and groups. How to do removing default filters from viewmodel in mvvm pattern. Presently I am handling the code from code behind.

ex:- Code behind

imageDiagramControl.SymbolPalette.SymbolGroups.Clear();

imageDiagramControl.SymbolPalette.SymbolFilters.Clear();

var group = new SymbolPaletteGroup();

group.Label = "Models";

SymbolPalette.SetFilterIndexes(group, new Int32Collection(new int[] { 0, 0 }));

imageDiagramControl.SymbolPalette.SymbolGroups.Add(group);

var filter = new SymbolPaletteFilter();

filter.Label = "Image";

imageDiagramControl.SymbolPalette.SymbolFilters.Add(filter);

var item1 = new SymbolPaletteItem();

var image = new Image();

var bitMapImage = new BitmapImage();

bitMapImage.BeginInit();

bitMapImage.UriSource = new Uri(@"pack://application:,,,/GuiControls;component/Images/SomeImage.ico");

bitMapImage.EndInit();

image.Stretch = Stretch.Fill;

image.Source = bitMapImage;

item1.Content = image;

group.Items.Add(item1);

 

 

I want this code should move to ViewModel. How can do that?

Thanks,

Ramana


3 Replies

RT Ramya Thirugnanam Syncfusion Team June 19, 2012 08:17 AM UTC

Hi Ramana,

With regards to add images to Diagram control from View Model in MVVM, we are working on your requirement. We will update you with the status of your requirement on June 22nd 2012.

Please let us know if you have any concerns,
Regards,
Ramya



SR Srinivas Rayudu June 28, 2012 04:09 PM UTC

We are using Syncfusion diagram. We have the similar requirement to use diagram control using the MVVM pattern. Is there any update on this?



RT Ramya Thirugnanam Syncfusion Team July 2, 2012 11:49 AM UTC

Hi Ramana,

Sorry for the delay in getting back to you.

With regards to add images to Diagram control from View Model in MVVM, DiagramControl supports MVVM partially.Currently, we do not have a support to achieve your requirement with MVVM. This is already in our feature queue. We will implement this feature in any of your future releases. We will get back to you once this implemented. So please create the Direct-Trac incident, to get quick update and to have better follow up.

Link: http://www.syncfusion.com/account/
please let us know if you have any concerns,
Regards,
Ramya
 


Loader.
Live Chat Icon For mobile
Up arrow icon