//主界面的后退键,用于在主界面点击了某个视频跳转到详情等界面 private void BackAppBarButton_Click(object sender, RoutedEventArgs e) { if (ListFrame.CanGoBack) { ListFrame.GoBack(); } }
public void ShowFileRow(ContentFile fileInfo, ContentRow rowInfo) { ListFrame.PushPage(null, fileInfo.Name, typeof(ContentDataTab), new ShowRowParam() { ShowContentFile = fileInfo, ShowContentRow = rowInfo }); }
private void Layoffs(Employee employee) { var element = ListFrame.ToList().FindLast(elem => ((PageUser_VM)((PageUser)elem.Content).DataContext).ID == employee.ID); MyWrapPanel.Children.Remove(element); Employees.Remove(employee); }
private void OnTicketToggleButtonClick(object sender, RoutedEventArgs e) { TicketToggleButton.IsChecked = true; TicketToggleButton.FontWeight = Windows.UI.Text.FontWeights.SemiBold; IncidentToggleButton.IsChecked = false; IncidentToggleButton.FontWeight = Windows.UI.Text.FontWeights.Normal; ListFrame.Navigate(typeof(TicketsListPaneView), _incidentId); }
public MenuClientiVM() { ItemInvokedCommand = new RelayCommand(NavigationTo); MenuItems.Add(new MenuItem() { MenuEntry = "Lista Clienti", Glyph = (new SymbolIconSource() { Symbol = Symbol.ContactInfo }).Symbol, }); MenuItems.Add(new MenuItem() { MenuEntry = "Geolocalizzazione", Glyph = (new SymbolIconSource() { Symbol = Symbol.World }).Symbol, }); MenuItems.Add(new MenuItem() { MenuEntry = "Recupero Clienti", Glyph = (new SymbolIconSource() { Symbol = Symbol.ReportHacked }).Symbol, }); void NavigationTo(object parameter) { NavigationViewItemInvokedEventArgs args = parameter as NavigationViewItemInvokedEventArgs; switch (args.InvokedItem.ToString()) { case "Lista Clienti": SelectedPage = new ListFrame() { DataContext = new ListaClientiVM() }; break; case "Geolocalizzazione": SelectedPage = new GeolocalizzazioneClienti() { DataContext = new GeolocalizzazioneClientiVM() }; break; case "Recupero Clienti": SelectedPage = new RecuperoClienti() { DataContext = new RecuperoClientiVM() }; break; } } }
public MainPage() { this.InitializeComponent(); ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(360, 120)); SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested; ListFrame.Navigate(typeof(ListPage)); EditFrame.Navigate(typeof(EditPage)); }
protected override void OnNavigatedTo(NavigationEventArgs e) { JsonObject parameters = JsonObject.Parse(e.Parameter as string); if (parameters != null) { mainAdaptiveVM.FromString(parameters["MainAdaptiveState"].GetString()); } ListFrame.Navigate(typeof(ListPage)); EditFrame.Navigate(typeof(EditPage), e.Parameter); }
public MainPage() { InitializeComponent(); Current = this; ListFrame.Navigate(typeof(ListPage)); NewFrame.Navigate(typeof(NewPage)); this.SizeChanged += (s, e) => { if (e.NewSize.Width > 800) { State = "All"; } else { if (State != "Detail") { State = "List"; } } }; SystemNavigationManager.GetForCurrentView().BackRequested += (s, e) => { if (IsSmallScreen()) { State = "List"; } ListPage.Current.ItemSelected = -1; }; // SetBackground ImageBrush imageBrush = new ImageBrush { ImageSource = new BitmapImage(new Uri("ms-appx:///Assets/Background1.jpg", UriKind.Absolute)) }; MainPageGrid.Background = imageBrush; // 恢复挂起状态 if (((App)App.Current).isSuspend) { if (ApplicationData.Current.LocalSettings.Values.ContainsKey("AddNewItem")) { var isEditState = (bool)ApplicationData.Current.LocalSettings.Values["AddNewItem"]; if (isEditState) { State = "Detail"; } } } if (State != "Detail") { State = "List"; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; if (e.Parameter is DashboardViewModel) { _viewModel = e.Parameter as DashboardViewModel; DataContext = _viewModel; _viewModel.Initialize(MapControl, (pageType, parameter) => ListFrame.Navigate(pageType, parameter)); } }
public ArticleView() { this.InitializeComponent(); ListFrame.Navigate(typeof(ArticleList)); DispatcherTimer time = new DispatcherTimer { Interval = new TimeSpan(0, 0, 5) }; time.Tick += Time_Tick; time.Start(); }
protected override void OnNavigatedTo(NavigationEventArgs ne) { ListFrame.Navigate(typeof(ListPage)); (ListFrame.Content as ListPage).Loaded += (object sender, RoutedEventArgs re) => { JsonObject parameters = JsonObject.Parse(ne.Parameter as string); if (parameters != null) { if (parameters.ContainsKey("MainAdaptiveState")) { MainAdaptiveViewModel.getInstance().FromString(parameters["MainAdaptiveState"].GetString()); } } EditFrame.Navigate(typeof(EditPage), ne.Parameter); }; }
/// <summary> /// Exibe os frames da camada selecionada. /// </summary> public void UpdateListFrame() { if (animation.FrameCount > 0) { ListFrame.BeginUpdate(); ListFrame.Items.Clear(); var count = animation.Count(animation.FrameIndex, selectedLayerIndex); for (var index = 0; index < count; index++) { ListFrame.Items.Add(animation[animation.FrameIndex, selectedLayerIndex, index].Name); } ListFrame.EndUpdate(); } }
private void LinkList_SelectionChanged(object sender, SelectionChangedEventArgs e) { ContentFile fileInfo = LinkList.SelectedItem as ContentFile; if (fileInfo == null) { return; } ListFrame.PushPage(null, fileInfo.Name, typeof(ContentDataTab), new ShowRowParam() { ShowContentFile = fileInfo }); //PathBaseFrame pathFrame = ParentBaseFrame as PathBaseFrame; //if (pathFrame == null) // return; //pathFrame.PushPage(PathItem, fileInfo.Name, typeof(ContentDataTab), fileInfo); }
//汉堡界面的选择切换 private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (Home.IsSelected) { //主界面 TitleTextBlock.Text = "Home"; InitializeList(); } else if (Collection.IsSelected) { //收藏界面 ListFrame.Navigate(typeof(CollectorItems)); TitleTextBlock.Text = "Collection"; } else if (Users.IsSelected) { ListFrame.Navigate(typeof(UserManagePage), user); TitleTextBlock.Text = user.Username; } }
private void AddNewEmployee(Employee employee) { Employees.Add(employee); ListFrame.Add(new Frame { Width = 140, Height = 230, Margin = new Thickness { Bottom = 0, Left = 10, Right = 0, Top = 20 }, Source = new Uri("Views/ManagerEmployee/PageUser.xaml", UriKind.Relative) }); int lastIndex = Employees.Count - 1; MyWrapPanel.Children.Add(ListFrame[lastIndex]); LastFrame = ListFrame[lastIndex]; Task.Factory.StartNew(() => { ConnectFrame(lastIndex, false); }); }
private void HandleDoubleClick(object sender, MouseButtonEventArgs e) { var track = ((ListViewItem)sender).Content as Track; //Casting back to the binded Track int selectedNumber = l_List__.Items.IndexOf(l_List__.SelectedItem); //MessageBox.Show("Item Double Click handled!"); switch (selectedNumber) { case 0: ListFrame.NavigationService.Navigate(new Uri(@"Lessons\Page1.xaml", UriKind.Relative)); l_List__.Visibility = Visibility.Hidden; ListFrame.Refresh(); break; case 1: ListFrame.NavigationService.Navigate(new Uri(@"Lessons\Page2.xaml", UriKind.Relative)); l_List__.Visibility = Visibility.Hidden; break; default: break; } }
private void ManagePage2Base_OnClick(object sender, RoutedEventArgs e) { ListFrame.Navigate(typeof(ManagePage2)); }
public void Refresh() { ListFrame.Clear(); }
public void NavigateTo(StorageFolder item) { ListFrame.Navigate(typeof(PostersPage), item); }
//private void showProgressRing() { // MyProgressRing.IsActive = true; // MyProgressRing.Visibility = Visibility.Visible; //} //private void killProgressRing() { // MyProgressRing.IsActive = false; // MyProgressRing.Visibility = Visibility.Collapsed; //} private async void InitializeList() { try { if (!first) { ListFrame.Navigate(typeof(ListPage), VideoTypeComboBox.SelectedIndex); } //如果选择的是电影类型 if (VideoTypeComboBox.SelectedIndex == 0) { //API请求,language是电影语言, page是搜索的页,用于支持翻页功能,翻一次页请求一次(API本身的限制只能这么做), Mgenre电影的类型, releaseYear电影放映日期, sortBy电影以热度还是评分排序 String url = String.Format("https://api.themoviedb.org/3/discover/movie?api_key=7888f0042a366f63289ff571b68b7ce0&include_adult=false{0}&page={1}{2}{3}{4}", language, page, Mgenre, releaseYear, sortBy); HttpClient client = new HttpClient(); String Jresult = await client.GetStringAsync(url); //本想把这句放在最前面,跳转更快,但是ListFrame实例化需要一点时间,放在前面会报空指针的错误,只好先请求网络给程序一点时间 if (first) { first = false; ListFrame.Navigate(typeof(ListPage), 0); } //Where is the Show progress ring code? Not here! //Written in XAML for initialization!!! //序列化电影列表,通过其解析Json,Models中除了Starlist,其他类都是通过网站json2csharp.com自动生成的 DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(QueryMovieList)); MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(Jresult)); QueryMovieList queryMovieList = (QueryMovieList)serializer.ReadObject(ms); //没有这类型的电影 if (queryMovieList.total_results == 0) { await new Windows.UI.Popups.MessageDialog("Found nothing, please change the key words and try again! ").ShowAsync(); } else { viewModel.clear(); foreach (var result in queryMovieList.results) { //该电影有海报 if (result.poster_path != null) { //修改为能访问的网址 result.poster_path = "https://image.tmdb.org/t/p/w500" + result.poster_path; } //没有海报 else { //使用默认海报 result.poster_path = "Assets/defaultPoster.jpg"; } //添加到ViewModel viewModel.AddMovieResult(result); } } } else { //同理 String url = String.Format("https://api.themoviedb.org/3/discover/tv?api_key=7888f0042a366f63289ff571b68b7ce0&include_adult=false{0}&page={1}{2}{3}", language, page, Tgenre, sortBy); HttpClient client = new HttpClient(); String Jresult = await client.GetStringAsync(url); if (first) { first = false; ListFrame.Navigate(typeof(ListPage), 1); } DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(QueryTVList)); MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(Jresult)); QueryTVList queryTVList = (QueryTVList)serializer.ReadObject(ms); if (queryTVList.total_results == 0) { await new Windows.UI.Popups.MessageDialog("Found nothing, please change the key words and try again! ").ShowAsync(); } else { viewModel.clear(); foreach (var result in queryTVList.results) { if (result.poster_path != null) { result.poster_path = "https://image.tmdb.org/t/p/w500" + result.poster_path; } else { result.poster_path = "Assets/defaultPoster.jpg"; } viewModel.AddTVResult(result); } } } } catch { await new Windows.UI.Popups.MessageDialog("Opps! Something wrong happened to the connection, please check your network and try again! ").ShowAsync(); } finally { MyProgressRing.IsActive = false; MyProgressRing.Visibility = Visibility.Collapsed; } }