private void lvNavi_SelectionChanged(object sender, SelectionChangedEventArgs e) { IPage page = null; NaviData selectData = lvNavi.SelectedItem as NaviData; ICollectionView view = CollectionViewSource.GetDefaultView(naviDatas); switch (selectData.NaviMenu) { case NaviMenu.Home: page = ctrlHome; ConvertNaviImage(selectData); App.bulletinData.LoadData(); view.Refresh(); break; case NaviMenu.Bulletin: page = ctrlBulletin; ConvertNaviImage(selectData); Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate() { ctrlBulletin.LoadDataAsync(); })); view.Refresh(); break; case NaviMenu.Option: ConvertNaviImage(selectData); page = ctrlOption; ctrlOption.OptionSynchronization(); view.Refresh(); break; } ShowPage(page); }
private void ConvertNaviImage(NaviData naviData) { int idx = 0; for (int i = 0; i < naviDataImages.Count - 3; i++) { naviDatas[idx].NaviImagePath = naviDataImages[i]; idx++; } idx = 0; switch (naviData.Title) { case "Home": naviDatas[0].NaviImagePath = naviDataImages[3]; break; case "Bulletin": naviDatas[1].NaviImagePath = naviDataImages[4]; break; case "Option": naviDatas[2].NaviImagePath = naviDataImages[5]; break; } }