MasterDetailPage中的BindingContext

时间:2019-08-24 12:50:25

标签: c# xamarin xamarin.forms

因此,将数据绑定到我的MasterDetailView时遇到麻烦。根据我在网上找到的消息来源,我没有收到任何错误,并且我的代码似乎是正确的。但是,没有什么填充我的MasterDetailView。

action

Cs

manifest_references.html

MasterPageItem类

<MasterDetailPage.Master>
    <ContentPage Title="Menu" BackgroundColor="#9BD2AD" x:Name="test">
        <StackLayout Orientation="Vertical">
            <Label Text="MENU" TextColor="#106073" HorizontalOptions="Center" FontAttributes="Bold" Margin="0,20,0,0" FontSize="Large"/>
            <ListView ItemsSource="{Binding listOfItems}" x:Name="navigationDrawerList" RowHeight="55" SeparatorVisibility="None"> <!--ItemSelected="NavigationDrawerList_ItemSelected"-->
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell> 
                            <StackLayout VerticalOptions="FillAndExpand" Orientation="Vertical" Padding="20,10,0,0">
                                <Label Text="{Binding Title}" TextColor="#106073" HorizontalTextAlignment="Start" FontSize="Medium"/>
                                <BoxView WidthRequest="2" HeightRequest="1" BackgroundColor="Beige"/>
                            </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </StackLayout>
    </ContentPage>
</MasterDetailPage.Master>

0 个答案:

没有答案