x:名称在C#Xamarin中无法识别

时间:2019-01-08 04:26:24

标签: xaml xamarin xamarin.forms

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

                                            <!--<Label VerticalOptions="FillAndExpand" Text="{Binding Cijena, StringFormat='{0} KM'}"></Label>-->
                                        </StackLayout>
                                        **<StackLayout Grid.Column="1" x:Name="LayNameLast"  Orientation="Horizontal" HorizontalOptions="End" VerticalOptions="CenterAndExpand" IsVisible="True" >
                                            <Entry TextColor="White"  x:Name="kolicinaIn" Text="1"  IsVisible="True"/>
                                            <Image IsEnabled="True" WidthRequest="23" HeightRequest="23" x:Name="naruciImg" Source="cart.png" VerticalOptions="Center"  IsVisible="True">**
                                                <!--<Image.GestureRecognizers>
                                                    <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"></TapGestureRecognizer>
                                                </Image.GestureRecognizers>-->
                                            </Image>
                                        </StackLayout>
                                    </Grid>
                                </ViewCell>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                </StackLayout>
            </StackLayout>

我在使用C#代码中的标记项时遇到问题,我尝试清洁,重建,重新启动PC,重新安装软件包,更改表格Build Action,甚至使用C#方法查找命名的布局和/或条目,但没有运气。我总是得到**名称kolicinaIn或layNameLast在当前上下文错误中不存在。 **

因此无法访问布局LayNameLast或其任何成员,但是我必须严格按此顺序进行操作,而且我必须能够访问它。

0 个答案:

没有答案