I have a following problem.
client.GetServiceMapCompleted += (s, e) =>
{
this.MyServiceMap = e.Result;
this.MyServiceMap.Categories.Add(new Category() { Name = " " });
this.MyServiceMap.Groups.Add(new Group() { Name = " " });
this.MyServiceMap.Groups.Sort((a, b) =>
{
return String.Compare(a.Name, b.Name);
});
this.MyServiceMap.Categories.Sort((a, b) =>
{
return String.Compare(a.Name, b.Name);
});
this._parents = MyServiceMap.Nodes;
this._children = MyServiceMap.Nodes;
};
client.GetServiceMapAsync();
I have MyServiceMap, Parents and Children properties:
private ServiceMap _serviceMap;
public ServiceMap MyServiceMap
{
get
{
return _serviceMap;
}
set
{
_serviceMap = value;
OnPropertyChanged("MyServiceMap");
}
}
private List<Node> _parents;
public List<Node> Parents
{
get
{
return _parents;
}
set
{
_parents = value;
OnPropertyChanged("Parents");
}
}
private List<Node> _children;
public List<Node> Children
{
get
{
return _children;
}
set
{
_children = value;
OnPropertyChanged("Children");
}
}
In UI i bind MyServiceMap to datagrid, Children and Parents to a listbox.
In a datagrid i see everything as supposed, but children and parents listbox field remains empty.
My question is why my UI is not refreshed after async calling and how to solve that?
Tnx in advanced 🙂
You’re setting the fields and not the properties (where you raise the
PropertyChanged) so your UI does not get notified about changes.should be