'XamarinForms CollectionView: is it possible to assign x:DataType from a different assembly?
I am a beginner with Xamarin.Forms. In my first project (more or less copied from the VS 2019 template 'Flyout') I have a collection of items defined in a view model. The elements of the collection are instances of a class defined in a different assembly. In the definition of the CollectionView the following has been added:
xmlns:local="clr-namespace:MyProject.ViewModels"
xmlns:model1="clr-namespace:MyLibrary.Domain;assembly=MyLibrary"
(MyLibrary is in an assembly different from that in which ViewModels are).
When I now try to define ItemSource and x:DataType for the CollectionView, there arises a problem: either I can define the ItemSource (from xmlns:local) or the DataType (from xmlns:model1), but not both. Is it generally possible to have the element class from a different assembly? And if yes (which I hope), how to do it correctly?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
