Skip to content

Conversation

Madhavansf
Copy link

Task

Load - On - Demand Null reference Exception Issue

Fix Details

private void ExecuteOnDemandLoading(object obj)
{
var node = obj as TreeViewNode;
node.ShowExpanderAnimation = true;
LoadOnDemandModel loadOnDemandModel = node.Content as LoadOnDemandModel
Application.Current.Resources.DispatcherQueue.TryEnqueue(() =>
{
var items = GetSubMenu(loadOnDemandModel.ID);
node.PopulateChildNodes(items);
if (items.Any())
node.IsExpanded = true;
node.ShowExpanderAnimation = false;
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant