Hey I have tried to use a Type as Parameter and using typeof(Class)
to get the type.
My problem is that i cant use the Type in a Task like this:
CreditorList = new ObservableCollection<DataModel>();
Is this possible??
Code for Reference:
private void Dg_Loaded(object sender, RoutedEventArgs e)
{
CreateList(typeof(CreditorClient));
}
async private void CreateList(Type DataModel)
{
CreditorList = new ObservableCollection<DataModel>();
}
Error:
Cannot implicitly convert type '...OberservableCollection' to '...DataModel.CreditorClient'