private void loadManually(mannualParam mannualparam) { secName.Text = mannualparam.boardname; int i = 0; foreach (string boardname in mannualparam.boardnameList) { ListViewItem single = new ListViewItem(); TextBlock singleText = new TextBlock(); singleText.Text = boardname; singleText.FontSize = 32; singleText.Tag = mannualparam.boardidList[i]; single.Content = singleText; ListView1.Items.Add(single); i++; } }
private void ListView1_ItemClick(object sender, ItemClickEventArgs e) { myParam myparam=new myParam(); TextBlock clickedItem = (TextBlock)e.ClickedItem; System.Diagnostics.Debug.WriteLine(clickedItem.Tag); myparam.boardid=clickedItem.Tag.ToString(); myparam.boardname=clickedItem.Text; System.Diagnostics.Debug.WriteLine(myparam.boardid); mannualParam mannualparam = new mannualParam(); mannualparam.boardnameList = new List<string>(); mannualparam.boardidList = new List<string>(); mannualparam.boardname = clickedItem.Text; switch (clickedItem.Tag.ToString()) { case "A.JOB": mannualparam.boardnameList.Add("官方勤工助学"); mannualparam.boardnameList.Add("家教信息"); mannualparam.boardnameList.Add("就业信息"); mannualparam.boardnameList.Add("其他兼职"); mannualparam.boardidList.Add("A.Work"); mannualparam.boardidList.Add("HomeTutor"); mannualparam.boardidList.Add("Jobs"); mannualparam.boardidList.Add("PartTime"); Frame.Navigate(typeof(boardPage),mannualparam); break; case "A.SecondHand": mannualparam.boardnameList.Add("美容服饰"); mannualparam.boardnameList.Add("图书市场"); mannualparam.boardnameList.Add("电脑数码"); mannualparam.boardnameList.Add("租房信息"); mannualparam.boardnameList.Add("交通工具"); mannualparam.boardnameList.Add("日用百货"); mannualparam.boardidList.Add("Beautylifestyle"); mannualparam.boardidList.Add("BookMarket"); mannualparam.boardidList.Add("DigiPCTrade"); mannualparam.boardidList.Add("RentingHouse"); mannualparam.boardidList.Add("Transport"); mannualparam.boardidList.Add("Z.riyongbaihuo"); Frame.Navigate(typeof(boardPage),mannualparam); break; case "Agent": mannualparam.boardnameList.Add("电脑数码代理"); mannualparam.boardnameList.Add("综合其他代理"); mannualparam.boardidList.Add("Digitalcomputers"); mannualparam.boardidList.Add("Z.OtherTrades"); Frame.Navigate(typeof(boardPage),mannualparam); break; case "graduatestudent": mannualparam.boardnameList.Add("考研资料交流"); mannualparam.boardnameList.Add("考研一族"); mannualparam.boardidList.Add("GCTbooktrade"); mannualparam.boardidList.Add("postgraduate"); Frame.Navigate(typeof(boardPage),mannualparam); break; case "Sportsgroup": mannualparam.boardnameList.Add("足球世界"); mannualparam.boardnameList.Add("NBA"); mannualparam.boardnameList.Add("体育运动"); mannualparam.boardidList.Add("football"); mannualparam.boardidList.Add("NBA"); mannualparam.boardidList.Add("Sports"); Frame.Navigate(typeof(boardPage),mannualparam); break; default: Frame.Navigate(typeof(ThreadListPage), myparam); break; } }