1
現在、私はXamarinに基づいてアプリケーションをプログラミングしています。私の目標は、テーブル内の値に基づいてスイッチを切り替えることです。問題は、Xamarinは私のx:Name toggle_trueが私のスイッチに接続されていることに気づいていません。トグルできませんスイッチ
はここにXAMLで私のスクリプトです:名前defineBuildingItems:それは、xがどのように認識するか
var currentQuestions = _define.Where(s => DefineId.Contains(s.defineId));
//Remember what building was defined like last time defineBuilding was proceeded.
foreach (DefineTable i in currentQuestions)
{
toggled_true.IsToggled = true;
}
defineBuildingItems.ItemsSource = posts;
base.OnAppearing();
}
お知らせ:
<ListView x:Name="defineBuildingItems">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal">
<StackLayout Orientation="Vertical">
<Label Text="{Binding defineDescription}" x:Name="Current_item"/>
</StackLayout>
<Switch BindingContext ="{Binding defineId}" HorizontalOptions="EndAndExpand"
Toggled="Handle_Toggled" x:Name="toggled_true"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
はここ背後にあるコードで私のC#コードです。 toggled_trueのエラーは次のようなものです。名前toggled_trueが現在の名前空間に存在しません。私が間違っているか紛失していることはありますか?