DisplayContainer should never call Load, DoubleClick should always Load

This commit is contained in:
John Lewin 2017-12-17 11:19:52 -08:00
parent 2c0f82dfd0
commit c8b700d6c6

View file

@ -160,12 +160,6 @@ namespace MatterHackers.MatterControl.CustomWidgets
var itemsContentView = contentView as IListContentView;
itemsContentView.ClearItems();
// Wait for the container to load
await Task.Run(() =>
{
sourceContainer.Load();
});
int width = itemsContentView.ThumbWidth;
int height = itemsContentView.ThumbHeight;
@ -308,7 +302,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
private void listViewItem_DoubleClick(object sender, MouseEventArgs e)
{
UiThread.RunOnIdle((Action)(async () =>
UiThread.RunOnIdle(async () =>
{
var listViewItem = sender as ListViewItem;
var itemModel = listViewItem.Model;
@ -320,6 +314,11 @@ namespace MatterHackers.MatterControl.CustomWidgets
if (containerLink != null)
{
var container = await containerLink.GetContainer(null);
await Task.Run(() =>
{
container.Load();
});
if (container != null)
{
container.Parent = ActiveContainer;
@ -366,7 +365,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
}
}
}
}));
});
}
public void SetActiveContainer(ILibraryContainer container)