forked from PrismLibrary/Prism
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d21e520
commit 2ed2821
Showing
13 changed files
with
240 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 18 additions & 3 deletions
21
e2e/Uno/src/HelloWorld.Shared/ViewModels/ShellViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Prism.Commands; | ||
using Prism.Mvvm; | ||
using Prism.Regions; | ||
|
||
namespace HelloWorld.ViewModels | ||
{ | ||
class ShellViewModel : BindableBase | ||
{ | ||
public string Title { get; set; } = "Hello Uno for Prism"; | ||
|
||
private DelegateCommand<string> _navigateCommand; | ||
private readonly IRegionManager _regionManager; | ||
|
||
public DelegateCommand<string> NavigateCommand => | ||
_navigateCommand ?? (_navigateCommand = new DelegateCommand<string>(ExecuteNavigateCommand)); | ||
|
||
public ShellViewModel(IRegionManager regionManager) | ||
{ | ||
_regionManager = regionManager; | ||
} | ||
|
||
void ExecuteNavigateCommand(string viewName) | ||
{ | ||
_regionManager.RequestNavigate("ContentRegion", viewName); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<Project Sdk="MSBuild.Sdk.Extras"> | ||
<!-- | ||
Adding project references to this project requires some manual adjustments. | ||
Please see https://github.com/unoplatform/uno/issues/3909 for more details. | ||
--> | ||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.0;xamarinios10;MonoAndroid11.0;MonoAndroid12.0;xamarinmac20</TargetFrameworks> | ||
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.18362;</TargetFrameworks> | ||
<!-- Ensures the .xr.xml files are generated in a proper layout folder --> | ||
<GenerateLibraryLayout>true</GenerateLibraryLayout> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="$(TargetFramework.StartsWith('xamarinios')) or $(TargetFramework.StartsWith('xamarinmac')) or $(TargetFramework.StartsWith('MonoAndroid')) or $(TargetFramework.StartsWith('netstandard'))"> | ||
<PackageReference Include="Uno.UI" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Page Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" /> | ||
<Compile Update="**\*.xaml.cs"> | ||
<DependentUpon>%(Filename)</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<UpToDateCheckInput Include="**\*.xaml" Exclude="bin\**\*.xaml;obj\**\*.xaml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Remove="Views\ViewA.xaml" /> | ||
<None Remove="Views\ViewB.xaml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<UpToDateCheckInput Remove="Views\ViewA.xaml" /> | ||
<UpToDateCheckInput Remove="Views\ViewB.xaml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\..\src\Prism.Core\Prism.Core.csproj" /> | ||
<ProjectReference Include="..\..\..\..\src\Uno\Prism.DryIoc.Uno\Prism.DryIoc.Uno.csproj" /> | ||
<ProjectReference Include="..\..\..\..\src\Uno\Prism.Uno\Prism.Uno.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="ViewModels\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Page Update="Views\ViewA.xaml"> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
<Page Update="Views\ViewB.xaml"> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using ModuleA.Views; | ||
using Prism.Ioc; | ||
using Prism.Modularity; | ||
using Prism.Regions; | ||
|
||
namespace ModuleA | ||
{ | ||
public class ModuleAModule : IModule | ||
{ | ||
private readonly IRegionManager _regionManager; | ||
|
||
public ModuleAModule(IRegionManager regionManager) | ||
{ | ||
_regionManager = regionManager; | ||
} | ||
|
||
public void RegisterTypes(IContainerRegistry containerRegistry) | ||
{ | ||
containerRegistry.RegisterForNavigation<ViewA>(); | ||
containerRegistry.RegisterForNavigation<ViewB>(); | ||
} | ||
|
||
public void OnInitialized(IContainerProvider containerProvider) | ||
{ | ||
//_regionManager.RegisterViewWithRegion<ViewA>("ContentRegion"); | ||
//_regionManager.RequestNavigate("ContentRegion", "ViewA"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<UserControl | ||
x:Class="ModuleA.Views.ViewA" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:ModuleA.Views" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<Grid> | ||
<TextBlock Text="View A" FontSize="72" /> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Windows.UI.Xaml.Controls; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace ModuleA.Views | ||
{ | ||
public sealed partial class ViewA : UserControl | ||
{ | ||
public ViewA() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<UserControl | ||
x:Class="ModuleA.Views.ViewB" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:ModuleA.Views" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<Grid> | ||
<TextBlock Text="View B" FontSize="72" /> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Windows.UI.Xaml.Controls; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace ModuleA.Views | ||
{ | ||
public sealed partial class ViewB : UserControl | ||
{ | ||
public ViewB() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |