【发布时间】:2018-03-26 08:21:20
【问题描述】:
我的 MainPage.xaml 代码:
<Page
x:Class="MyProject.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyProject"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x1="using:System"
mc:Ignorable="d">
<Frame HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Name="frameMainPage"></Frame>
我的 LoginViewModel.cs 代码
...
if (m_login.Username == "username" && m_login.Password == "password")
{
Singleton.User = m_login;
App.log.Info("Success! Login done!");
//load in frame the dashboard page after login.
}
...
如何获取我的框架并加载到 Dashboard.xaml 页面? 可以从视图模型中做到这一点吗?
我的目标是在 MainPage.xaml 框架中加载页面。 谢谢
【问题讨论】:
-
如何获取我的框架并在 Dashboard.xaml 页面中加载? 您要加载哪个框架?
MainPage? -
@NicoZhu-MSFT 我想从 viewmodel 调用 frameMainPage 并在它的框架内加载新页面。
标签: c# xaml uwp win-universal-app frame