提交 6be7f4d3 编写于 作者: J Jerome Laban

chore: Adjust datacontext override to use the inherited `Frame` value

上级 6c2860a7
......@@ -211,7 +211,11 @@ namespace Uno.UI.RemoteControl.HotReload
// In the case of Page, swapping the actual page is not supported, so we
// need to swap the content of the page instead. This can happen if the Frame
// is using a native presenter which does not use the `Frame.Content` property.
oldPage.DataContext = null;
// Clear any local context, so that the new page can inherit the value coming
// from the parent Frame. It may happen if the old page set it explicitly.
oldPage.ClearValue(Page.DataContextProperty, DependencyPropertyValuePrecedences.Local);
oldPage.Content = newPage;
newPage.Frame = oldPage.Frame;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册