Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2045
HospitalFloorSample how to refresh element
posted

I add button to Hospital Floor sample and want to change fill color in one bed. On click event I have these code

var vm = (HospitalFloorPlanViewModel)DataContext;

IEnumerable<TestFloor.ViewModels.MapElementViewModel> mevm =  vm.MapElements;

HospitalFloorPlanViewModel hfvm = new HospitalFloorPlanViewModel();

hfvm.ChangeColor(mevm);

Here is ChangeColor function in HospitalFloorPlanViewModel class

public void ChangeColor(IEnumerable<MapElementViewModel> ele)
{
 var t = ele.FirstOrDefault(x => x.Name == "0");

 t.Fill = new SolidColorBrush(Colors.Red);
}

The problem is bed color not refreshing unless I Check/uncheck one of the filter checks (bed Status filter). I tried to use bedLayer.ImportAsync();, but it's not working for me. How can I refresh one map element?

Thanks