Windows Phone 7 네트워크 프로그래밍 일기예보 적용
ForecastPage.xaml
- <phone:PhoneApplicationPage
- x:Class="WeatherForecast.ForecastPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
- xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- FontFamily="{StaticResource PhoneFontFamilyNormal}"
- FontSize="{StaticResource PhoneFontSizeNormal}"
- Foreground="{StaticResource PhoneForegroundBrush}"
- SupportedOrientations="Portrait" Orientation="Portrait"
- mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
- shell:SystemTray.IsVisible="True">
-
- <Grid x:Name="LayoutRoot" Background="Transparent">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12">
- <TextBlock x:Name="ApplicationTitle" Text=" " Style="{StaticResource PhoneTextNormalStyle}"/>
- <TextBlock x:Name="PageTitle" Text="{Binding City}" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextNormalStyle}"/>
- </StackPanel>
- <Grid x:Name="ContentGrid" Grid.Row="1" Margin="12,0,12,0">
- <ListBox Height="618" HorizontalAlignment="Left" Margin="0,5,0,0" Name="ForecastList" VerticalAlignment="Top" Width="474" Grid.RowSpan="2" SelectionChanged="ForecastList_SelectionChanged" >
- <ListBox.ItemTemplate><!-- -->
- <DataTemplate>
- <Grid >
- <Grid.RowDefinitions>
- <RowDefinition Height="80"/>
- <RowDefinition Height="80"/>
- <RowDefinition />
- <RowDefinition Height="*" MinHeight="80" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="90" />
- <ColumnDefinition Width="70"/>
- <ColumnDefinition Width="180"/>
- <ColumnDefinition Width="90"/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="{Binding Day_of_week}" Foreground="LightBlue" FontSize="40" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"/>
- <Image Source="{Binding Icon}" Grid.Column="0" Grid.Row="0" VerticalAlignment="Bottom" HorizontalAlignment="Right" Grid.ColumnSpan="2" />
- <TextBlock Text=" (K)" FontSize="30" Foreground="LightBlue" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2"/>
- <TextBlock Text="{Binding Low}" FontSize="30" Foreground="White" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
- <TextBlock Text=" (K)" FontSize="30" Foreground="LightBlue" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"/>
- <TextBlock Text="{Binding High}" FontSize="30" Foreground="White" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
- <TextBlock Text="{Binding Condition}" FontSize="25" Foreground="White" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" TextWrapping="Wrap"/>
-
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </Grid>
- </phone:PhoneApplicationPage>
- using System.Windows.Controls;
- using Microsoft.Phone.Controls;
- using System.Windows.Navigation;
-
- namespace WeatherForecast
- {
- public partial class ForecastPage : PhoneApplicationPage
- {
- Forecast forecast;
-
- public ForecastPage()
- {
- InitializeComponent();
- }
-
- /// <summary>
- /// ,
- /// </summary>
- protected override void OnNavigatedTo(NavigationEventArgs e)
- {
- // City
- string cityPinyin = this.NavigationContext.QueryString["City"];
- forecast = new Forecast();
- //
- forecast.GetForecast(cityPinyin);
- // forecast
- DataContext = forecast;
- // ForecastList forecast.ForecastList
- ForecastList.ItemsSource = forecast.ForecastList;
- }
-
- private void ForecastList_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- ForecastList.SelectedIndex = -1;
- ForecastList.SelectedItem = null;
-
- }
- }
- }
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
제한된 크기의 디렉토리를 만드는 방법오늘 저는 장치에 공간이 없을 때 백업 중에 응용 프로그램이 어떻게 작동하는지 테스트(및 수정)하는 작업이 있습니다. 결과적으로 "남은 공간 없음"오류로 백업이 실패하면 새 파일이 없어야 합니다. 지금까지 문제를 재...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.