Skip to content

Commit

Permalink
ランキング動画一覧ページの更新ボタンがオフライン時に押せるように修正。
Browse files Browse the repository at this point in the history
  • Loading branch information
tor4kichi committed Feb 26, 2024
1 parent d42f3b4 commit 1956f18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Hohoema/ViewModels/HohoemaListingPageViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ protected override async Task<IEnumerable<ITEM_VM>> LoadDataAsync(CancellationTo
public AdvancedCollectionView? ItemsView { get; private set; }

[ObservableProperty]
[NotifyPropertyChangedFor(nameof(CanRefresh))]
private bool _nowLoading;

partial void OnNowLoadingChanged(bool value)
Expand Down Expand Up @@ -261,7 +262,9 @@ private void OnLodingItemError(Exception e)
_logger.ZLogError(e, "failed on incremental loadingItems.");
}

[RelayCommand]
public bool CanRefresh => !NowLoading;

[RelayCommand(CanExecute = nameof(CanRefresh))]
protected void ResetList()
{
_dispatcherQueue.TryEnqueue(() =>
Expand Down
2 changes: 1 addition & 1 deletion Hohoema/Views.Niconico/Search/SearchResultKeywordPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</AppBarButton>

<AppBarButton x:Name="SelectionToggleButton" Icon="List" Label="{i18nExt:Localize Key=Select}" Command="{x:Bind _vm.SelectionModeToggleCommand}" />
<AppBarButton x:Name="RefreshButton" Label="{i18nExt:Localize Key=Refresh}" Icon="Refresh" Command="{x:Bind _vm.ResetListCommand}" IsEnabled="{x:Bind _vm.CanChangeSort, Mode=OneWay}" VerticalAlignment="Center"></AppBarButton>
<AppBarButton x:Name="RefreshButton" Label="{i18nExt:Localize Key=Refresh}" Icon="Refresh" Command="{x:Bind _vm.ResetListCommand}" VerticalAlignment="Center"></AppBarButton>
</CommandBar.PrimaryCommands>
<CommandBar.SecondaryCommands>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
Label="{i18nExt:Localize Key=Refresh}"
Icon="Refresh"
Command="{x:Bind _vm.ResetListCommand}"
IsEnabled="{x:Bind _vm.CanChangeSort, Mode=OneWay}"
VerticalAlignment="Center"
>
</AppBarButton>
Expand Down

0 comments on commit 1956f18

Please sign in to comment.