Mainpage.xaml.cs code
public partial class MainPage : PhoneApplicationPage
{ string f;
// Constructor
public MainPage()
{
InitializeComponent();
WebClient webClient = new WebClient();
webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted);
webClient.DownloadStringAsync(new Uri("http://www.taxmann.com/TaxmannWhatsnewService/mobileservice.aspx?service=topstories"));
}
void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
var rootObject = JsonConvert.DeserializeObject<List<NewsItem>>(e.Result);
foreach (var item in rootObject)
{
// Console.WriteLine(item.news_id + "new_id");
f += '|'+item.news_id;
//f ='|' + item.news_id;
}
lstEmployee.ItemsSource = rootObject;
}
private void lstEmployee_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
int selindex = lstEmployee.SelectedIndex;
//ListBox sourceList = sender as ListBox;
//ListBox.se
(Application.Current as App).selectedNewsItem = lstEmployee.Items[lstEmployee.SelectedIndex] as NewsItem;
NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
}
}
public class NewsItem
{
public string news_id { get; set; }
public string news_title { get; set; }
public string website_link { get; set; }
public string imagepath { get; set; }
public string news_date { get; set; }
public string image_path { get; set; }
public string news_detail_description { get; set; }
}
}
page1.xaml.cs
public Page1()
{
InitializeComponent();
Loaded += new RoutedEventHandler(Page1_Loaded);
}
void Page1_Loaded(object sender, RoutedEventArgs e)
{
NewsItem selectedNewsItem = (Application.Current as App).selectedNewsItem;
// TextBlockNewsDescription.Text = selectedNewsItem.news_detail_description;
string strURI= selectedNewsItem.news_detail_description;
// strURI.Replace("<link href='http://www.taxmann.com/css/taxmannstyle.css' rel='stylesheet' type='text/css' />", "");
// string k = "<html><body style='background-color:Black;font-size:30px;color:#fff;'>" + strURI + "</body></html>";
string k = "<html><body href='http://www.taxmann.com/css/taxmannstyle.css' rel='stylesheet' type='text/css'>" + strURI + "</body></html>";
webBrowser1.NavigateToString(k);
}
}
}
我想申請翻頁中的Page1.xaml我能夠在列表視圖顯示在MainPage.xaml中的數據,並在page1.xaml.cs即時通訊顯示數據在網頁視圖根據其主頁的項目現在我想page1.xaml翻轉假設用戶在下一頁翻轉然後下一個項目詳細showuld顯示在,如果前翻轉,那麼它應該顯示以前的新聞細節。 (如Android查看傳呼機)如何申請翻頁在Windows Phone 7的新聞基於應用
我在窗口創建基於新聞應用程序Phone 7的請幫我
我可以有烏爾電子郵件ID,這樣我可以送U我Proejct怎麼我做到了但我希望頁面翻頁在第二頁,如果我們翻轉下一頁然後它應該dsiplay下一個項目的詳細信息新聞....如果我們翻轉以前那麼它應該顯示上一個新聞新聞即時顯示新的細節在web視圖第二頁ok – user2148026 2013-03-25 07:45:58