In VS2017 mit XamarinMit ResourceDictionary.MergedDictionaries in App.xaml
In meinem app.xaml
habe ich eine MergedDictionary, die eine XAML enthält meine Datatemplate verweist. Es wird von einer Inhaltsseite nicht erkannt. Wenn ich das DataTemplate in die app.xaml verschiebe, funktioniert es gut.
Wie bekomme ich die <ResourceDictionary.MergedDictionaries>
, um die StaticResource zu erkennen, die in CellTemplates.xaml
definiert ist?
Mein App.xaml:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/CellTemplates.xaml"/>
</ResourceDictionary.MergedDictionaries>
....
Mein CellTemplates.xaml:
<ResourceDictionary
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DataTemplate x:Key="CustomerTemplate">
<ViewCell Height="100">
<StackLayout VerticalOptions="FillAndExpand">
....
Mein Inhalt Seite:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Muffin"
x:Class="Muffin.MainPage">
<ScrollView>
<ListView ItemsSource="{Binding Customers}"
HasUnevenRows="True"
ItemTemplate="{StaticResource CustomerTemplate}">
</ListView>
....