Skip to content

Commit

Permalink
强制导航页面
Browse files Browse the repository at this point in the history
  • Loading branch information
kitUIN committed Aug 15, 2023
1 parent 3ae9f94 commit 94b3892
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ShadowViewer.Core/Args/NavigateToEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ public class NavigateToEventArgs : EventArgs
public object Parameter { get; }
public Uri Url { get; }
public Type Page { get; }
public NavigateToEventArgs(Type page, object parameter)
public bool Force { get; }
public NavigateToEventArgs(Type page, object parameter, bool force)
{
Page = page;
Parameter = parameter;
Force = force;
}
public new string ToString()
{
Expand Down
3 changes: 1 addition & 2 deletions ShadowViewer.Core/Interfaces/ICallableService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public partial interface ICallableService
/// <summary>
/// 控制页面跳转
/// </summary>
void NavigateTo(Type page, object parameter);
void NavigateTo(Type page, object parameter, bool force = false);
/// <summary>
/// 刷新书架
/// </summary>
Expand Down Expand Up @@ -108,5 +108,4 @@ public partial interface ICallableService
void PicturesLoadStarting(PicViewModel sender,PicViewArg arg);
}


}
4 changes: 2 additions & 2 deletions ShadowViewer.Core/Services/CallableService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ public void ImportComicProgress(double progress)
/// <summary>
/// <inheritdoc/>
/// </summary>
public void NavigateTo(Type page, object parameter)
public void NavigateTo(Type page, object parameter,bool force=false)
{
var args = new NavigateToEventArgs(page, parameter);
var args = new NavigateToEventArgs(page, parameter, force);
NavigateToEvent?.Invoke(this, args);
Logger.Debug("触发事件NavigateTo{A}", args.ToString());
}
Expand Down

0 comments on commit 94b3892

Please sign in to comment.