前提・実現したいこと
Visual Studio 2019 for Macを使用し、
Xamarinでスマートフォン向けアプリを作成しています。
xamlで宣言したラベルに対して、
xaml.cs側でテキストなどに、値を入れる際に
「testPage.LblMessage'と'testPage.LblMessage'間があいまいです。」
と同じクラス間であいまいとエラーが出てしまいます。
xaml側で宣言した全てのコントロールのプロパティに値を入れる際に、
エラーが発生しています。
解決するにはどのようにすればよろしいのでしょうか?
発生している問題・エラーメッセージ
testPage.LblMessage'と'testPage.LblMessage'間があいまいです。
該当のソースコード
c#
1//xaml 2<?xml version="1.0" encoding="UTF-8"?> 3<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 4 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 5 x:Class="test.Views.GroupCreatingPage"> 6 <StackLayout Orientation="Vertical" 7 Spacing="20" 8 VerticalOptions="CenterAndExpand" 9 HorizontalOptions="CenterAndExpand"> 10 <Image Source="blue_folder.png" WidthRequest="200" HeightRequest="200"/> 11 <Entry x:Name="edtGroupName" 12 FontSize="Large" 13 HorizontalTextAlignment="Start" 14 HorizontalOptions="FillAndExpand" 15 VerticalOptions="Center" /> 16 <StackLayout Orientation="Horizontal" 17 Spacing="20"> 18 <Button x:Name="BtnChange" 19 VerticalOptions="Center" 20 BackgroundColor="#e0e2e5" 21 BorderColor="#e0e2e5" 22 BorderWidth="1" 23 TextColor="Black" 24 WidthRequest="150" 25 Clicked="OkButtonClicked" /> 26 27 <Button x:Name="BtnCancel" 28 VerticalOptions="Center" 29 BackgroundColor="#e0e2e5" 30 BorderColor="#e0e2e5" 31 BorderWidth="1" 32 TextColor="Black" 33 WidthRequest="150" 34 Clicked="CancelButtonClicked" /> 35 </StackLayout> 36 </StackLayout> 37</ContentPage> 38 39 40//xmal.cs 41public partial class GroupCreatingPage : ContentPage 42 { 43 CarLocker CarLockers; 44 45 public GroupCreatingPage(CarLocker car) 46 { 47 InitializeComponent(); 48 CarLockers = car; 49 50 BtnChange.Text = AppResources.Button_Change;//エラー発生箇所 51 BtnCancel.Text = AppResources.Button_Cancel;//エラー発生箇所 52 if (CarLockers != null) 53 { 54 edtGroupName.Text = CarLockers.CarNumber;//エラー発生箇所 55 } 56 else 57 { 58 edtGroupName.Text = "";//エラー発生箇所 59 } 60 edtGroupName.TextChanged += EdtGroupName_TextChanged;//エラー発生箇所 61 } 62}