Hello,
I have a Treemap with an ObservableCollection :
public interface IIntensityMapViewModel { ObservableCollection Values { get; set; }
void Refresh(double[,] value); }
public class IntensityMapViewModel : IIntensityMapViewModel {
public IntensityMapViewModel() { Values = new ObservableCollection(); }
public ObservableCollection Values { get; set; }
public void Refresh(double[,] value) { var i = 0; foreach (var item in value) { Values.Add(new Value { Id = i, Name = item.ToString() }); i++; } } }
public class IntensityMapDesignViewModel : IIntensityMapViewModel { public ObservableCollection Values { get { return new ObservableCollection { new Value { Id = 0, Name = "1" }, new Value { Id = 1, Name = "2" }, new Value { Id = 2, Name = "3" }, new Value { Id = 3, Name = "4" }, new Value { Id = 4, Name = "5" }, new Value { Id = 5, Name = "6" } }; } set { } }
public void Refresh(double[,] plot) { }
In use, the map will contains 20 to 276 nodes, that why I put a small minSize.
The refresh method is never called, so there are always 6 nodes displayed.
Could you help me ?
Thanks for your help.
Regards
Hi teamtim,
I'm not sure I understand what you are asking. The Refresh method in your view model is not going to get called by the XamTreemap control. You have to trigger the refresh call and how you do that is up to you. Can you explain in a bit more detail what you are trying to accomplish?
Do you still require assistance on this matter?