나는 창 전화에서 일하고있다. Windows Phone의 그리드에 데이터를 바인딩해야합니다. Windows Phone 7의 그리드에 값 웹 서비스를 바인드하는 방법은 무엇입니까?
나는 이름, 주소, ID, 카테고리 등 웹 서비스의 결과를 얻었다. 필요합니다 이름을 클릭하면 모든 세부 정보가 표시됩니다. 그런 세부 사항을 표시하려면 어떻게해야합니까?
0
A
답변
2
마이크가 말했듯이 새로운 DataBound 애플리케이션의 일부로 생성 된 코드를 살펴보십시오.
또한, 오히려 그리드에 데이터를 표시하는 것보다, 그것은 열에서 수직으로 데이터를 표시하는 아마 더 나은 :
을 :<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel>
<TextBlock Text="Name" Style="{StaticResource PhoneTextLargeStyle}" />
<TextBlock Text="{}Binding Name}" Margin="20,0,0,0" />
<TextBlock Text="ID" Style="{StaticResource PhoneTextLargeStyle}" />
<TextBlock Text="{Binding ID}" Margin="20,0,0,0" />
<TextBlock Text="City" Style="{StaticResource PhoneTextLargeStyle}" />
<TextBlock Text="{Binding City}" Margin="20,0,0,0" />
<TextBlock Text="Category" Style="{StaticResource PhoneTextLargeStyle}" />
<TextBlock Text="{Binding Category}" Margin="20,0,0,0" />
<TextBlock Text="Others" Style="{StaticResource PhoneTextLargeStyle}" />
<TextBlock Text="{Binding Others}" Margin="20,0,0,0" TextWrapping="Wrap" />
</StackPanel>
</Grid>
그리고이 채워 때 어떻게 보이는지 볼 수있는 빠른 방법으로
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();
Loaded += MainPage_Loaded;
}
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
// This would really be the data returned from the web service
var sampleData = new WsData
{
Name = "Girilas & Gandhi Nagar",
ID = "842",
City = "Bangalore",
Category = "Shopping Mall",
Others = "AC Types: central\n AC, Split AC Windows\nACWhirlpool:\nMicrowave Oven ..."
};
this.DataContext = sampleData;
}
}
public class WsData
{
public string Name { get; set; }
public string ID { get; set; }
public string City { get; set; }
public string Category { get; set; }
public string Others { get; set; }
}
1
데이터 바인딩 프로젝트 템플릿을 사용하여 프로젝트를 만드는 것이 좋습니다. 출발점으로 사용할 수있는 것과 매우 유사한 결과를 생성하기 때문입니다.
관련 문제
- 1. Windows Phone 7의 App.config?
- 2. Windows Phone 7의 방향을 결정하는 방법은 무엇입니까?
- 3. Windows Phone 7의 HttpWebRequest.Proxy?
- 4. Windows Phone 7의 DataContractJsonSerializer
- 5. Windows Phone 7의 SHOUTcast
- 6. Windows Phone 7의 Silverlight 웹 콘텐츠
- 7. Windows Phone 7의 환경 설정
- 8. 웹 서비스를 Windows Phone 7 장치로 제한하는 방법은 무엇입니까?
- 9. Windows Phone 7의 스타일 트리거
- 10. Windows Phone 7의 MessageBox에있는 TextBox
- 11. Windows Phone 7의 ListBox 메뉴
- 12. Windows Phone 7의 텍스트 음성화
- 13. Windows Phone 7의 버튼 배열
- 14. Windows Phone 7의 데이터 바인딩?
- 15. Windows Phone 7의 본국 검색
- 16. Windows Phone 7의 테마 재정의
- 17. Windows Phone 7의 XAP 파일은 무엇입니까?
- 18. Windows Phone 7의 QueryString 개념은 무엇입니까?
- 19. Phone 7의 WebService - 근본적인 질문
- 20. Windows phone 7의 목록 상자에 항목을 표시하는 방법은 무엇입니까?
- 21. Windows Phone 7의 목록 컨트롤에 열을 추가하는 방법은 무엇입니까?
- 22. Windows Phone 7에서 SOAP 서비스를 시작하는 방법은 무엇입니까?
- 23. Silverlight를 사용하는 Windows Phone 7의 3D 모델
- 24. Windows phone 7의 치히기 텍스트 7
- 25. Windows Phone 7의 타일을 업데이트하려면 어떻게해야합니까?
- 26. 프로그래밍 방식으로 Windows Phone 7의 docx 열기
- 27. Windows Phone 7의 데이터베이스 테스트 mango
- 28. C# Windows Phone 7의 Facebook 채팅 클라이언트
- 29. Windows Phone 7의 플래시 카드 뒤집기 애니메이션
- 30. Windows Phone 7의 터치 이벤트 Mango IE
Windows Phone 7에서 DataBound priject 템플릿 사용 방법 – selladurai
후속 질문에 대한 답변을 늦게 드려 죄송합니다. 새 프로젝트로 이동하면 프로젝트 템플릿에 대해 Windows Phone 데이터 바인딩 된 응용 프로그램을 선택하십시오. 이것은 당신이 볼 수있는 실제 샘플을 생성 할 것입니다. –