MVVM 跨 WPF 区域实现
MVVM Cross WPF Region Implementation
如何用MVVM Cross和WPF来实现这个view presentation;菜单、选项卡和内容视图?我找不到任何实际的例子如何做到这一点。这是一个过时的实现 https://github.com/ThallisonRhanniel/MvvmCross-Samples/tree/master/XPlatformMenus 但我想使用 MvvmCross(6.x) 和 MvvmCross.Platforms.Wpf(6.x).
主窗口:
[MvxWindowPresentation(Identifier = nameof(MainWindow), Modal = false)]
public partial class MainWindow : MvxWindow<MainWindowViewModel>
菜单:
[MvxContentPresentation(WindowIdentifier = nameof(MainWindow), StackNavigation = true)]
[MvxRegion("MenuContent")]
[MvxViewFor(typeof(MenuViewModel))]
public partial class MenuView
标签栏:
[MvxContentPresentation(WindowIdentifier = nameof(MainWindow), StackNavigation = true)]
[MvxRegion("PageContent")]
[MvxViewFor(typeof(TabViewModel))]
public partial class TabView
使用区域属性;
public class MvxRegionPresentationAttribute : MvxBasePresentationAttribute
{
public string RegionName { get; set; }
public string WindowIdentifier { get; set; }
}
里面MainWindow.xaml;
<Frame x:Name="MenuContent"
Grid.Column="0"
NavigationUIVisibility="Hidden"></Frame>
<Frame x:Name="PageContent"
Grid.Column="1"
NavigationUIVisibility="Hidden"></Frame>
如何在 MVVMCross 中实现区域 6.x?
在搜索所有 mvvmcross wpf github 项目后,我发现了各种实现,但只有一个更新版本;
https://github.com/eiadxp/MvvmCross.Platforms.Wpf.ItemsViewPresenter
它使用 MvvmCross(6.x) 和 MvvmCross.Platforms.Wpf(6.x).
如何用MVVM Cross和WPF来实现这个view presentation;菜单、选项卡和内容视图?我找不到任何实际的例子如何做到这一点。这是一个过时的实现 https://github.com/ThallisonRhanniel/MvvmCross-Samples/tree/master/XPlatformMenus 但我想使用 MvvmCross(6.x) 和 MvvmCross.Platforms.Wpf(6.x).
主窗口:
[MvxWindowPresentation(Identifier = nameof(MainWindow), Modal = false)]
public partial class MainWindow : MvxWindow<MainWindowViewModel>
菜单:
[MvxContentPresentation(WindowIdentifier = nameof(MainWindow), StackNavigation = true)]
[MvxRegion("MenuContent")]
[MvxViewFor(typeof(MenuViewModel))]
public partial class MenuView
标签栏:
[MvxContentPresentation(WindowIdentifier = nameof(MainWindow), StackNavigation = true)]
[MvxRegion("PageContent")]
[MvxViewFor(typeof(TabViewModel))]
public partial class TabView
使用区域属性;
public class MvxRegionPresentationAttribute : MvxBasePresentationAttribute
{
public string RegionName { get; set; }
public string WindowIdentifier { get; set; }
}
里面MainWindow.xaml;
<Frame x:Name="MenuContent"
Grid.Column="0"
NavigationUIVisibility="Hidden"></Frame>
<Frame x:Name="PageContent"
Grid.Column="1"
NavigationUIVisibility="Hidden"></Frame>
如何在 MVVMCross 中实现区域 6.x?
在搜索所有 mvvmcross wpf github 项目后,我发现了各种实现,但只有一个更新版本; https://github.com/eiadxp/MvvmCross.Platforms.Wpf.ItemsViewPresenter 它使用 MvvmCross(6.x) 和 MvvmCross.Platforms.Wpf(6.x).