내 page.xaml에는 다음과 같은 선언이 있습니다.
<Label Text="Location" Style="{StaticResource labelStyle}" />
<ContentView Style="{StaticResource fieldView}">
<Label Text="{Binding Title}" Style="{StaticResource fieldStyle}" />
</ContentView>
xaml.cs 페이지에서 Location.Text 변수에 액세스하려고합니다. 그러나 구문에 액세스 할 수 없습니다.
뒤에있는 코드에서 액세스하려면 요소에 이름을 할당해야합니다.
XAML에서 :
<Label x:Name="txtLoc" Text="Location" Style="{StaticResource labelStyle}" />
뒤에있는 코드에서 :
var loc = txtLoc.Text;
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다