public async Task ReloadAsync() { var items = await this.GetSourceAsync(); JasilyDebug.Pointer(); if (items != null) { this.OnResetFilter(this.FilterText); this.Items.View.CustomSort = null; this.Items.View.GroupDescriptions?.Clear(); this.Items.Collection.Clear(); if (this.IsOnlyTracking) { this.Items.View.CustomSort = new VideoInfoViewModel.GroupComparer(); this.Items.View.GroupDescriptions?.Add( new PropertyGroupDescription(nameof(VideoInfoViewModel.VideoGroup) + "." + nameof(VideoInfoViewModel.Group.Title))); } else { this.Items.View.CustomSort = new VideoInfoViewModel.DefaultComparer(); } this.Items.Collection.AddRange(items); this.Items.View.Refresh(); } }
public SeriesSelectorPage() { JasilyDebug.Pointer(); this.InitializeComponent(); JasilyDebug.Pointer(); this.EditSeriesUserControl.ViewModel.Created += this.EditSeriesUserControl_ViewModel_Created; }
public SeriesEditorWindow Initialize(SeriesViewModel series) { JasilyDebug.Pointer(); this.EditSeriesUserControl.ViewModel.Updated += this.ViewModel_Updated; JasilyDebug.Pointer(); this.EditSeriesUserControl.ViewModel.ModifyMode(series); JasilyDebug.Pointer(); return(this); }
private void NavigateToSeriesSelectorPage() { this.TitleTextBlock.Text = "select series"; this.LastButton.Visibility = Visibility.Hidden; JasilyDebug.Pointer(); this.ContentFrame.Navigate(this.seriesSelectorPage); JasilyDebug.Pointer(); }
public async Task LoadAsync() { var seriesManager = this.GetManagers().SeriesManager; JasilyDebug.Pointer(); this.Items.Collection.AddRange( await Task.Run(async() => (await seriesManager.LoadAsync()) .Select(z => new SeriesViewModel(z)))); JasilyDebug.Pointer(); }
/// <summary> /// 引发 <see cref="E:System.Windows.FrameworkElement.Initialized"/> 事件。 每当在内部将 <see cref="P:System.Windows.FrameworkElement.IsInitialized"/> 设置为 true 时,都将调用此方法。 /// </summary> /// <param name="e">包含事件数据的 <see cref="T:System.Windows.RoutedEventArgs"/>。</param> protected override async void OnInitialized(EventArgs e) { JasilyDebug.Pointer(); base.OnInitialized(e); this.EditSeriesUserControl.ViewModel.CreateMode(); this.DataContext = this.SelectorViewModel; await this.SelectorViewModel.LoadAsync(); JasilyDebug.Pointer(); }
private async void LazyFilter() { var text = this.FilterText; await Task.Delay(400); if (text == this.FilterText) { if (this.OnResetFilter(text)) { JasilyDebug.Pointer(); this.Items.View.Refresh(); } } }
private async Task InitializeQueryAsync(SeriesManager manager) { JasilyDebug.Pointer(); var items = this.isOnlyTracking ? await Task.Run(async() => (await manager.ListTrackingAsync()).ToList()) : await Task.Run(async() => (await this.BuildQueryAsync(manager)).ToList()); JasilyDebug.Pointer(); this.HasNext = !this.isOnlyTracking && items.Count > this.pageSize; if (this.HasNext) { items.RemoveAt(items.Count - 1); } this.Items = items; }
private async Task <IEnumerable <VideoInfoViewModel> > GetSourceAsync() { this.HasLast = this.HasNext = false; var dataCenter = this.GetManagers(); var search = this.searchResultView; if (search == null || !search.IsSearchTextEquals(this.SearchText)) { this.PageIndex = 0; } search = this.IsOnlyTracking ? await SearchResult.OnlyTrackingAsync(dataCenter) : await SearchResult.SearchAsync(dataCenter, this.SearchText, this.PageIndex, this.PageSize); this.searchResultView = search; this.HasLast = search.HasLast; this.HasNext = search.HasNext; JasilyDebug.Pointer(); var svm = search.Items.Select(z => new SeriesViewModel(z)).ToArray(); svm.ForEach(z => { z.NameViewModel.IsBuildQueryStrings = true; z.NameViewModel.BeginRebuildQueryStrings(); }); var r = svm.SelectMany(z => z.VideoViewModels) .Where(z => this.searchResultView.IsMatch(z.SeriesView, z)) .ToArray(); if (this.IsOnlyTracking) { this.RebuildGroupFactoryAndRefreshItems(r); } this.serieses = svm; JasilyDebug.Pointer(); return(r); }
public override void WriteToObject(T obj) { JasilyDebug.Pointer(); base.WriteToObject(obj); JasilyDebug.Pointer(); }
public override void ReadFromObject(T obj) { JasilyDebug.Pointer(); base.ReadFromObject(obj); JasilyDebug.Pointer(); }