나는 Windows phone 8 app을 개발 중입니다. 내 응용 프로그램의 일부에서 사용자 응답이 필요합니다. Windows 전화 사용자 정의 컨트롤 페이지를 만듭니다. 사용자가 목록 상자에서 값을 선택합니다. UserControl을 페이지목록 상자 선택 항목을 얻는 방법 mainpage xaml에서 태그
에 여기에 내가 내가 내가 TextBlock에 도달하지 못할 사용자 제어 페이지에 대한 클래스 객체를 생성 할 때 mainpage.xaml.But에있는 TextBlock의 텍스트를 선택 얻을하려는 내 사용자 관리 페이지
<Grid x:Name="columngrid" Background="#FF1FCB4E" Width="480" >
<Grid.RowDefinitions>
<RowDefinition Height="300"/>
<RowDefinition Height="70"/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<ListBox Name="URLListBox" Grid.Row="0" Background="#FF1FCB4E" >
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#FF0B232F" BorderThickness="2">
<TextBlock x:Name="surename" Width="460" Tag="{Binding b1Tag}" Height="80" FontSize="25" Text="{Binding text}" Foreground="#FFBF9595" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0" />
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Grid.Row="1" x:Name="btnOK" Content="OK" Background="#FF892121" />
<Button Grid.Row="2" x:Name="btnCancel" Content="Cancel" Background="#FF892121"/>
</Grid>
의 코드입니다. listbox. 도달 할 수있는 방법은 내가 선택한 텍스트 블록의 텍스트를 얻을 수 있습니다 나는 이것을 시도하지만 난 Listbox 객체를 가져올 것임을 깨달았습니다.
surah popupsurah = new surah();//usercontrol page
Popup popup2 = new Popup();
private void ApplicationBarIconButton_Click(object sender, EventArgs e)
{
collapsedgrid.Visibility = Visibility.Collapsed;
popupsurah.URLListBox.Tap += (s, args) =>
{
string transferID = ((TextBlock)s).Text as string;
여기에 도움이되는 샘플이 있습니다. http://www.geekchamp.com/tips/how-to-expose-properties-of-a-user-control-in-windows-phone –