mirror of
https://github.com/leiurayer/downkyi.git
synced 2025-03-23 07:40:12 +08:00
如果前往的页面与当前页面相同,则不添加新的页面到页面栈中
This commit is contained in:
parent
e5310718ab
commit
63b7fd9063
@ -11,7 +11,7 @@ public partial class VideoDetailViewModel : ViewModelBase
|
||||
public const string Key = "VideoDetail";
|
||||
|
||||
// 保存输入字符串,避免被用户修改
|
||||
private string? input = null;
|
||||
private string? _input = null;
|
||||
|
||||
#region 页面属性申明
|
||||
|
||||
@ -85,6 +85,12 @@ public partial class VideoDetailViewModel : ViewModelBase
|
||||
{
|
||||
base.OnNavigatedTo(parameter);
|
||||
|
||||
if (parameter!.ContainsKey("value"))
|
||||
{
|
||||
_input = (string)parameter["value"];
|
||||
InputText = _input;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -125,10 +125,15 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
var viewModel = SetContent(viewKey);
|
||||
if (viewModel == null) { return; }
|
||||
|
||||
// 如果前往的页面与当前页面相同,
|
||||
// 则不添加新的页面到页面栈中
|
||||
if (viewModel != Content)
|
||||
{
|
||||
_pages.Push(viewKey);
|
||||
}
|
||||
|
||||
viewModel.OnNavigatedTo(parameter);
|
||||
Content = viewModel;
|
||||
|
||||
_pages.Push(viewKey);
|
||||
}
|
||||
|
||||
public void Backward(Dictionary<string, object>? parameter = null)
|
||||
|
Loading…
Reference in New Issue
Block a user