RapidTravel impr, GoBack/Forward, header navigation
This commit is contained in:
@@ -26,12 +26,21 @@ public abstract partial class AppStateBase : IAppState
|
||||
|
||||
public IDeclarativeProperty<ITabViewModel?> SelectedTab { get; private set; }
|
||||
public DeclarativeProperty<string?> RapidTravelText { get; private set; }
|
||||
public IDeclarativeProperty<string?> RapidTravelTextDebounced { get; private set; }
|
||||
|
||||
public IDeclarativeProperty<string?> ContainerStatus { get; private set; }
|
||||
|
||||
partial void OnInitialize()
|
||||
{
|
||||
RapidTravelText = new("");
|
||||
RapidTravelTextDebounced = RapidTravelText
|
||||
.Debounce(v =>
|
||||
string.IsNullOrEmpty(v)
|
||||
? TimeSpan.Zero
|
||||
: TimeSpan.FromMilliseconds(200)
|
||||
, resetTimer: true
|
||||
);
|
||||
|
||||
ViewMode = _viewMode;
|
||||
|
||||
SearchText = _searchText.AsObservable();
|
||||
|
||||
@@ -53,7 +53,7 @@ public abstract partial class ItemViewModel : IItemViewModel
|
||||
|
||||
var displayName = itemViewModelType switch
|
||||
{
|
||||
ItemViewModelType.Main => _appState.RapidTravelText.Map(async (s, _) =>
|
||||
ItemViewModelType.Main => _appState.RapidTravelTextDebounced.Map(async (s, _) =>
|
||||
_appState.ViewMode.Value != Models.Enums.ViewMode.RapidTravel
|
||||
&& _appState.SelectedTab.Value?.CurrentLocation.Value?.Provider is IItemNameConverterProvider nameConverterProvider
|
||||
? (IReadOnlyList<ItemNamePart>) await nameConverterProvider.GetItemNamePartsAsync(item)
|
||||
|
||||
@@ -138,7 +138,7 @@ public partial class TabViewModel : ITabViewModel
|
||||
CurrentSelectedItemAsContainer = CurrentSelectedItem.Map(i => i as IContainerViewModel);
|
||||
|
||||
SelectedsChildren = CurrentSelectedItem
|
||||
.Debounce(() => _refreshSmoothnessCalculator.RefreshDelay, resetTimer: true)
|
||||
.Debounce(_ => _refreshSmoothnessCalculator.RefreshDelay, resetTimer: true)
|
||||
.DistinctUntilChanged()
|
||||
.Map(item =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user