diff options
author | Brian Lagunas <brian.lagunas@live.com> | 2016-02-15 21:10:49 +0300 |
---|---|---|
committer | Brian Lagunas <brian.lagunas@live.com> | 2016-02-15 21:10:49 +0300 |
commit | 75dc1116d298027598ac4391afb21aa503806718 (patch) | |
tree | 8e25b3458fe6e064d4b6b8e1dfd9ff40b51ade5a /Sandbox | |
parent | fb9aaa7205d663083970456717056bb72ee1c466 (diff) | |
parent | ecc47b5ccc42a9d0811478c1c704d0dfd423a1f8 (diff) |
Merge remote-tracking branch 'refs/remotes/origin/master' into 6.2-Preview
Diffstat (limited to 'Sandbox')
30 files changed, 380 insertions, 359 deletions
diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld.sln b/Sandbox/Xamarin/HelloWorld/HelloWorld.sln index 738e0d1..7fce815 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld.sln +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "HelloWorld\HelloWorld\HelloWorld.csproj", "{94318F08-2F60-4E7F-8C43-86B024BFF115}" EndProject @@ -23,6 +23,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prism.Ninject.Forms", "..\. EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Unity", "Unity", "{1F38DE96-6945-4467-92C4-20D9DF20121E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleA", "ModuleA\ModuleA.csproj", "{C491DC4B-EB12-4882-AC69-E18382A50D75}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{3455E365-0698-46FF-AD63-E0BF6035B8BF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -491,6 +495,56 @@ Global {F8424F1D-A7BF-4113-AF23-0F0A7BE6BBB1}.Release-Signed|iPhoneSimulator.Build.0 = Release-Signed|Any CPU {F8424F1D-A7BF-4113-AF23-0F0A7BE6BBB1}.Release-Signed|x86.ActiveCfg = Release-Signed|Any CPU {F8424F1D-A7BF-4113-AF23-0F0A7BE6BBB1}.Release-Signed|x86.Build.0 = Release-Signed|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|ARM.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Ad-Hoc|x86.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|Any CPU.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|Any CPU.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|ARM.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|ARM.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|iPhone.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|iPhone.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|x86.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.AppStore|x86.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|ARM.ActiveCfg = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|ARM.Build.0 = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|iPhone.Build.0 = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|x86.ActiveCfg = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Debug|x86.Build.0 = Debug|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|Any CPU.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|ARM.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|ARM.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|iPhone.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|iPhone.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|x86.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release|x86.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|Any CPU.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|ARM.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|ARM.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|iPhone.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|iPhone.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|iPhoneSimulator.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|iPhoneSimulator.Build.0 = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|x86.ActiveCfg = Release|Any CPU + {C491DC4B-EB12-4882-AC69-E18382A50D75}.Release-Signed|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -504,5 +558,7 @@ Global {67F9D3A8-F71E-4428-913F-C37AE82CDB24} = {1FFDC467-1594-4138-A3DA-91ABC5D45BFA} {79EBB8F1-5D80-4EA1-9100-EBDC1EC51CB7} = {1FFDC467-1594-4138-A3DA-91ABC5D45BFA} {F8424F1D-A7BF-4113-AF23-0F0A7BE6BBB1} = {1FFDC467-1594-4138-A3DA-91ABC5D45BFA} + {C491DC4B-EB12-4882-AC69-E18382A50D75} = {3455E365-0698-46FF-AD63-E0BF6035B8BF} + {3455E365-0698-46FF-AD63-E0BF6035B8BF} = {1F38DE96-6945-4467-92C4-20D9DF20121E} EndGlobalSection EndGlobal diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.Droid/HelloWorld.Droid.csproj b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.Droid/HelloWorld.Droid.csproj index 5dfab17..153ef9d 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.Droid/HelloWorld.Droid.csproj +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.Droid/HelloWorld.Droid.csproj @@ -141,6 +141,10 @@ <Project>{79ebb8f1-5d80-4ea1-9100-ebdc1ec51cb7}</Project> <Name>Prism.Unity.Forms</Name> </ProjectReference> + <ProjectReference Include="..\..\ModuleA\ModuleA.csproj"> + <Project>{c491dc4b-eb12-4882-ac69-e18382a50d75}</Project> + <Name>ModuleA</Name> + </ProjectReference> <ProjectReference Include="..\HelloWorld\HelloWorld.csproj"> <Name>HelloWorld</Name> </ProjectReference> diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.WinPhone/HelloWorld.WinPhone.csproj b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.WinPhone/HelloWorld.WinPhone.csproj index f5d2ccf..924cdc1 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.WinPhone/HelloWorld.WinPhone.csproj +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.WinPhone/HelloWorld.WinPhone.csproj @@ -173,6 +173,10 @@ <Project>{79ebb8f1-5d80-4ea1-9100-ebdc1ec51cb7}</Project> <Name>Prism.Unity.Forms</Name> </ProjectReference> + <ProjectReference Include="..\..\ModuleA\ModuleA.csproj"> + <Project>{c491dc4b-eb12-4882-ac69-e18382a50d75}</Project> + <Name>ModuleA</Name> + </ProjectReference> <ProjectReference Include="..\HelloWorld\HelloWorld.csproj"> <Name>HelloWorld</Name> </ProjectReference> diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.iOS/HelloWorld.iOS.csproj b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.iOS/HelloWorld.iOS.csproj index 7f2f829..573da45 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.iOS/HelloWorld.iOS.csproj +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld.iOS/HelloWorld.iOS.csproj @@ -111,6 +111,10 @@ <Project>{79ebb8f1-5d80-4ea1-9100-ebdc1ec51cb7}</Project> <Name>Prism.Unity.Forms</Name> </ProjectReference> + <ProjectReference Include="..\..\ModuleA\ModuleA.csproj"> + <Project>{c491dc4b-eb12-4882-ac69-e18382a50d75}</Project> + <Name>ModuleA</Name> + </ProjectReference> <ProjectReference Include="..\HelloWorld\HelloWorld.csproj"> <Name>HelloWorld</Name> </ProjectReference> diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/App.cs b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/App.cs index 1a3e01c..bed576a 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/App.cs +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/App.cs @@ -1,4 +1,5 @@ using HelloWorld.Views; +using Prism.Modularity; using Prism.Unity; namespace HelloWorld @@ -14,11 +15,13 @@ namespace HelloWorld { Container.RegisterTypeForNavigation<MainPage>(); Container.RegisterTypeForNavigation<MyNavigationPage>(); - Container.RegisterTypeForNavigation<MyTabbedPage>(); Container.RegisterTypeForNavigation<MyMasterDetail>(); - Container.RegisterTypeForNavigation<ViewA>(); - Container.RegisterTypeForNavigation<ViewB>(); - Container.RegisterTypeForNavigation<ViewC>(); + } + + protected override void ConfigureModuleCatalog() + { + //ModuleCatalog.AddModule(new ModuleInfo(typeof(ModuleA.ModuleAModule))); + ModuleCatalog.AddModule(new ModuleInfo("ModuleA", typeof(ModuleA.ModuleAModule), InitializationMode.OnDemand)); } } } diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/HelloWorld.csproj b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/HelloWorld.csproj index 11ce98f..0ca241b 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/HelloWorld.csproj +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/HelloWorld.csproj @@ -42,10 +42,6 @@ <Compile Include="ViewModels\MainPageViewModel.cs" /> <Compile Include="ViewModels\MyMasterDetailViewModel.cs" /> <Compile Include="ViewModels\MyNavigationPageViewModel.cs" /> - <Compile Include="ViewModels\MyTabbedPageViewModel.cs" /> - <Compile Include="ViewModels\ViewAViewModel.cs" /> - <Compile Include="ViewModels\ViewBViewModel.cs" /> - <Compile Include="ViewModels\ViewCViewModel.cs" /> <Compile Include="ViewModels\ViewModelBase.cs" /> <Compile Include="Views\MainPage.xaml.cs"> <DependentUpon>MainPage.xaml</DependentUpon> @@ -56,18 +52,6 @@ <Compile Include="Views\MyNavigationPage.xaml.cs"> <DependentUpon>MyNavigationPage.xaml</DependentUpon> </Compile> - <Compile Include="Views\MyTabbedPage.xaml.cs"> - <DependentUpon>MyTabbedPage.xaml</DependentUpon> - </Compile> - <Compile Include="Views\ViewA.xaml.cs"> - <DependentUpon>ViewA.xaml</DependentUpon> - </Compile> - <Compile Include="Views\ViewB.xaml.cs"> - <DependentUpon>ViewB.xaml</DependentUpon> - </Compile> - <Compile Include="Views\ViewC.xaml.cs"> - <DependentUpon>ViewC.xaml</DependentUpon> - </Compile> </ItemGroup> <ItemGroup> <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> @@ -107,12 +91,10 @@ <Project>{79ebb8f1-5d80-4ea1-9100-ebdc1ec51cb7}</Project> <Name>Prism.Unity.Forms</Name> </ProjectReference> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Views\ViewB.xaml"> - <Generator>MSBuild:UpdateDesignTimeXaml</Generator> - <SubType>Designer</SubType> - </EmbeddedResource> + <ProjectReference Include="..\..\ModuleA\ModuleA.csproj"> + <Project>{c491dc4b-eb12-4882-ac69-e18382a50d75}</Project> + <Name>ModuleA</Name> + </ProjectReference> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Views\MainPage.xaml"> @@ -121,30 +103,12 @@ </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="Views\ViewA.xaml"> - <Generator>MSBuild:UpdateDesignTimeXaml</Generator> - <SubType>Designer</SubType> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Views\ViewC.xaml"> - <Generator>MSBuild:UpdateDesignTimeXaml</Generator> - <SubType>Designer</SubType> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> <EmbeddedResource Include="Views\MyNavigationPage.xaml"> <Generator>MSBuild:UpdateDesignTimeXaml</Generator> <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="Views\MyTabbedPage.xaml"> - <Generator>MSBuild:UpdateDesignTimeXaml</Generator> - <SubType>Designer</SubType> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> <EmbeddedResource Include="Views\MyMasterDetail.xaml"> <Generator>MSBuild:UpdateDesignTimeXaml</Generator> <SubType>Designer</SubType> diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/MainPageViewModel.cs b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/MainPageViewModel.cs index 9e04f69..894aa2e 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/MainPageViewModel.cs +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/MainPageViewModel.cs @@ -1,16 +1,14 @@ using HelloWorld.Interfaces; using Prism.Commands; -using Prism.Events; using Prism.Mvvm; -using Prism.Navigation; +using Prism.Modularity; using System; namespace HelloWorld.ViewModels { public class MainPageViewModel : ViewModelBase { - private readonly INavigationService _navigationService; - private readonly IEventAggregator _eventAggregator; + private readonly IModuleManager _moduleManager; string _title = "Main Page"; public string Title @@ -19,36 +17,17 @@ namespace HelloWorld.ViewModels set { SetProperty(ref _title, value); } } - public DelegateCommand NavigateCommand { get; set; } + public DelegateCommand LoadModuleACommand { get; set; } - public MainPageViewModel(INavigationService navigationService, IEventAggregator eventAggregator) + public MainPageViewModel(IModuleManager moduleManager) { - _navigationService = navigationService; - _eventAggregator = eventAggregator; - - NavigateCommand = new DelegateCommand(Navigate); + _moduleManager = moduleManager; + LoadModuleACommand = new DelegateCommand(LoadModuleA); } - void Navigate() + void LoadModuleA() { - var basic = "http://www.brianlagunas.com/MyNavigationPage/ViewA/ViewC/"; - - var nonHttp = "MyMasterDetail?id=1/MyNavigationPage?id=Nav/ViewA?id=A/ViewB?id=B"; - - //var uri = new Uri(basic, UriKind.Relative); - - _navigationService.Navigate(basic); - } - - public override void OnNavigatedFrom(NavigationParameters parameters) - { - base.OnNavigatedFrom(parameters); - } - - public override void OnNavigatedTo(NavigationParameters parameters) - { - base.OnNavigatedTo(parameters); + _moduleManager.LoadModule("ModuleA"); } } - } diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/MyTabbedPageViewModel.cs b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/MyTabbedPageViewModel.cs deleted file mode 100644 index 0c71e2b..0000000 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/MyTabbedPageViewModel.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Prism.Navigation; -using System.Collections.Generic; -using System.Collections.ObjectModel; - -namespace HelloWorld.ViewModels -{ - public class MyTabbedPageViewModel : ViewModelBase - { - string _title = "My Tabbed Page"; - public string Title - { - get { return _title; } - set { SetProperty(ref _title, value); } - } - - private ObservableCollection<MonkeyDataModel> _pages; - public ObservableCollection<MonkeyDataModel> Pages - { - get { return _pages; } - set { SetProperty(ref _pages, value); } - } - - private MonkeyDataModel _selectedPage; - public MonkeyDataModel SelectedPage - { - get { return _selectedPage; } - set { SetProperty(ref _selectedPage, value); } - } - - public MyTabbedPageViewModel() - { - Pages = new ObservableCollection<MonkeyDataModel>(MonkeyDataModel.All); - } - - public override void OnNavigatedFrom(NavigationParameters parameters) - { - - } - - public override void OnNavigatedTo(NavigationParameters parameters) - { - //var selectedItemName = (string)parameters["selectedItem"]; - - //SelectedPage = Pages.Where(p => p.Name == selectedItemName).FirstOrDefault(); - } - } - - public class MonkeyDataModel - { - static MonkeyDataModel() - { - All = new ObservableCollection<MonkeyDataModel> - { - new MonkeyDataModel - { - Name = "Chimpanzee", - Family = "Hominidae", - Subfamily = "Homininae", - Tribe = "Panini", - Genus = "Pan", - PhotoUrl="http://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Schimpanse_Zoo_Leipzig.jpg/640px-Schimpanse_Zoo_Leipzig.jpg" - }, - new MonkeyDataModel - { - Name = "Orangutan", - Family = "Hominidae", - Subfamily = "Ponginae", - Genus = "Pongo", - PhotoUrl="http://upload.wikimedia.org/wikipedia/commons/b/be/Orang_Utan%2C_Semenggok_Forest_Reserve%2C_Sarawak%2C_Borneo%2C_Malaysia.JPG" - }, - new MonkeyDataModel - { - Name = "Tamarin", - Family = "Callitrichidae", - Genus = "Saguinus", - PhotoUrl="http://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Tamarin_portrait_2_edit3.jpg/640px-Tamarin_portrait_2_edit3.jpg" - } - }; - } - - public string Name { set; get; } - - public string Family { set; get; } - - public string Subfamily { set; get; } - - public string Tribe { set; get; } - - public string Genus { set; get; } - - public string PhotoUrl { set; get; } - - public static IList<MonkeyDataModel> All { set; get; } - } -} diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MainPage.xaml b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MainPage.xaml index c1546a1..9480f61 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MainPage.xaml +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MainPage.xaml @@ -6,8 +6,7 @@ x:Class="HelloWorld.Views.MainPage"> <StackLayout> <Label Text="{Binding Title}" VerticalOptions="Center" HorizontalOptions="Center" /> - <Button Command="{Binding NavigateCommand}" Text="Navigate" /> - <Button Text="Hard Coded Navigation Test" Clicked="Button_Clicked" /> + <Button Command="{Binding LoadModuleACommand}" Text="Load Module A" /> </StackLayout> </ContentPage>
\ No newline at end of file diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MainPage.xaml.cs b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MainPage.xaml.cs index c492c8b..1c4ebd7 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MainPage.xaml.cs +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MainPage.xaml.cs @@ -29,15 +29,15 @@ namespace HelloWorld.Views //Navigation.PushModalAsync(p1, false); //BUG: TabbedPage tab header are not shown, only first page in TabbedPage children is shown. - var p1 = new MyNavigationPage(); - var p2 = new ViewA(); - var p3 = new ViewC(); - var p4 = new MyTabbedPage(); - - p3.Navigation.PushAsync(p4, false); - p2.Navigation.PushAsync(p3, false); - p1.Navigation.PushAsync(p2, false); - Navigation.PushModalAsync(p1, false); + //var p1 = new MyNavigationPage(); + //var p2 = new ViewA(); + //var p3 = new ViewC(); + //var p4 = new MyTabbedPage(); + + //p3.Navigation.PushAsync(p4, false); + //p2.Navigation.PushAsync(p3, false); + //p1.Navigation.PushAsync(p2, false); + //Navigation.PushModalAsync(p1, false); //BUG: Results in the MyTabbedPage tab headers showing on ViewC. Hit the back button, pops to ViewB, then ViewA, then to the TabbedPage page as expected. diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyMasterDetail.xaml b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyMasterDetail.xaml index 603f72b..b47d355 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyMasterDetail.xaml +++ b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyMasterDetail.xaml @@ -6,12 +6,12 @@ x:Class="HelloWorld.Views.MyMasterDetail"> <MasterDetailPage.Master> - <ContentPage Title="My MatserDetailPage"> - <StackLayout> + <ContentPage Title="Default"> + <!--<StackLayout> <Button Text="ViewA" Command="{Binding NavigateCommand}" CommandParameter="ViewA?id=A" /> <Button Text="ViewB" Command="{Binding NavigateCommand}" CommandParameter="ViewB?id=B" /> <Button Text="ViewC" Command="{Binding NavigateCommand}" CommandParameter="ViewC?id=C" /> - </StackLayout> + </StackLayout>--> </ContentPage> </MasterDetailPage.Master> diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyTabbedPage.xaml b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyTabbedPage.xaml deleted file mode 100644 index dd174c6..0000000 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyTabbedPage.xaml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" - xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - xmlns:converters="clr-namespace:HelloWorld.Converters;assembly=HelloWorld" - xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" - prism:ViewModelLocator.AutowireViewModel="False" - ItemsSource="{Binding Pages}" - SelectedItem="{Binding SelectedPage}" - x:Class="HelloWorld.Views.MyTabbedPage"> - - <TabbedPage.Resources> - <ResourceDictionary> - <converters:NonNullToBooleanConverter x:Key="booleanConverter" /> - </ResourceDictionary> - </TabbedPage.Resources> - - <TabbedPage.ItemTemplate> - <DataTemplate> - <ContentPage Title="{Binding Name}" Icon="monkeyicon.png"> - <StackLayout Padding="5, 25"> - - <Label Text="{Binding Name}" - Font="Bold,Large" - HorizontalOptions="Center" /> - - <Image Source="{Binding PhotoUrl}" - WidthRequest="200" - HeightRequest="200" /> - - <StackLayout Padding="50, 10"> - - <StackLayout Orientation="Horizontal"> - <Label Text="Family:" - HorizontalOptions="FillAndExpand" /> - <Label Text="{Binding Family}" - Font="Bold,Medium" /> - </StackLayout> - - <StackLayout Orientation="Horizontal" - IsVisible="{Binding Subfamily, - Converter={StaticResource booleanConverter}}"> - <Label Text="Subfamily:" - HorizontalOptions="FillAndExpand" /> - <Label Text="{Binding Subfamily}" - Font="Bold,Medium" /> - </StackLayout> - - <StackLayout Orientation="Horizontal" - IsVisible="{Binding Tribe, - Converter={StaticResource booleanConverter}}"> - <Label Text="Tribe:" - HorizontalOptions="FillAndExpand" /> - <Label Text="{Binding Tribe}" - Font="Bold,Medium" /> - </StackLayout> - - <StackLayout Orientation="Horizontal"> - <Label Text="Genus:" - HorizontalOptions="FillAndExpand" /> - <Label Text="{Binding Genus}" - Font="Bold,Medium" /> - </StackLayout> - </StackLayout> - </StackLayout> - </ContentPage> - </DataTemplate> - </TabbedPage.ItemTemplate> - - -</TabbedPage>
\ No newline at end of file diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyTabbedPage.xaml.cs b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyTabbedPage.xaml.cs deleted file mode 100644 index 05ad75b..0000000 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyTabbedPage.xaml.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Prism.Navigation; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using Xamarin.Forms; - -namespace HelloWorld.Views -{ - public partial class MyTabbedPage : TabbedPage - { - public MyTabbedPage() - { - InitializeComponent(); - - Children.Add(new ViewA()); - Children.Add(new ViewB()); - Children.Add(new ViewC()); - } - } -} - diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewA.xaml.cs b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewA.xaml.cs deleted file mode 100644 index 0ae694c..0000000 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewA.xaml.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Prism.Navigation; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using Xamarin.Forms; - -namespace HelloWorld.Views -{ - public partial class ViewA : ContentPage, INavigationAware - { - public ViewA() - { - InitializeComponent(); - } - - public void OnNavigatedFrom(NavigationParameters parameters) - { - - } - - public void OnNavigatedTo(NavigationParameters parameters) - { - - } - } -} diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewC.xaml.cs b/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewC.xaml.cs deleted file mode 100644 index 3f3c2b8..0000000 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewC.xaml.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Prism.Navigation; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using Xamarin.Forms; - -namespace HelloWorld.Views -{ - public partial class ViewC : ContentPage - { - public ViewC() - { - InitializeComponent(); - } - } -} diff --git a/Sandbox/Xamarin/HelloWorld/ModuleA/ModuleA.csproj b/Sandbox/Xamarin/HelloWorld/ModuleA/ModuleA.csproj new file mode 100644 index 0000000..93b6f99 --- /dev/null +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/ModuleA.csproj @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{C491DC4B-EB12-4882-AC69-E18382A50D75}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ModuleA</RootNamespace> + <AssemblyName>ModuleA</AssemblyName> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + <TargetFrameworkProfile>Profile78</TargetFrameworkProfile> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <NuGetPackageImportStamp> + </NuGetPackageImportStamp> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Compile Include="ModuleAModule.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="ViewModels\ViewAViewModel.cs" /> + <Compile Include="ViewModels\ViewBViewModel.cs" /> + <Compile Include="ViewModels\ViewCViewModel.cs" /> + <Compile Include="Views\MasterNavigation.xaml.cs"> + <DependentUpon>MasterNavigation.xaml</DependentUpon> + </Compile> + <Compile Include="Views\ViewA.xaml.cs"> + <DependentUpon>ViewA.xaml</DependentUpon> + </Compile> + <Compile Include="Views\ViewB.xaml.cs"> + <DependentUpon>ViewB.xaml</DependentUpon> + </Compile> + <Compile Include="Views\ViewC.xaml.cs"> + <DependentUpon>ViewC.xaml</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\..\Source\Prism\Prism.csproj"> + <Project>{e6c50355-d01e-4caa-884d-d7929861315c}</Project> + <Name>Prism</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\..\Source\Xamarin\Prism.Forms\Prism.Forms.csproj"> + <Project>{67f9d3a8-f71e-4428-913f-c37ae82cdb24}</Project> + <Name>Prism.Forms</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\..\Source\Xamarin\Prism.Unity.Forms\Prism.Unity.Forms.csproj"> + <Project>{79ebb8f1-5d80-4ea1-9100-ebdc1ec51cb7}</Project> + <Name>Prism.Unity.Forms</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath> + <Private>True</Private> + </Reference> + <Reference Include="Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f, processorArchitecture=MSIL"> + <HintPath>..\packages\Unity.4.0.1\lib\portable-net45+wp80+win8+wpa81+MonoAndroid10+MonoTouch10\Microsoft.Practices.Unity.dll</HintPath> + <Private>True</Private> + </Reference> + <Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath> + <Private>True</Private> + </Reference> + <Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath> + <Private>True</Private> + </Reference> + <Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath> + <Private>True</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Views\ViewB.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Views\ViewA.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Views\ViewC.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Views\MasterNavigation.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> + <Import Project="..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" /> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" /> + </Target> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/Sandbox/Xamarin/HelloWorld/ModuleA/ModuleAModule.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/ModuleAModule.cs new file mode 100644 index 0000000..846716c --- /dev/null +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/ModuleAModule.cs @@ -0,0 +1,29 @@ +using Microsoft.Practices.Unity; +using ModuleA.Views; +using Prism.Modularity; +using Prism.Unity; +using Xamarin.Forms; + +namespace ModuleA +{ + public class ModuleAModule : IModule + { + readonly IUnityContainer _container; + + public ModuleAModule(IUnityContainer container) + { + _container = container; + } + + public void Initialize() + { + _container.RegisterTypeForNavigation<ViewA>(); + _container.RegisterTypeForNavigation<ViewB>(); + _container.RegisterTypeForNavigation<ViewC>(); + + var masterDetail = PrismApplication.Current.MainPage as MasterDetailPage; + if (masterDetail != null) + masterDetail.Master = new MasterNavigation(); + } + } +} diff --git a/Sandbox/Xamarin/HelloWorld/ModuleA/Properties/AssemblyInfo.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ef71e59 --- /dev/null +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Properties/AssemblyInfo.cs @@ -0,0 +1,30 @@ +using System.Resources; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ModuleA")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ModuleA")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/ViewAViewModel.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/ViewModels/ViewAViewModel.cs index d59a368..0222714 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/ViewAViewModel.cs +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/ViewModels/ViewAViewModel.cs @@ -2,9 +2,9 @@ using Prism.Mvvm; using Prism.Navigation; -namespace HelloWorld.ViewModels +namespace ModuleA.ViewModels { - public class ViewAViewModel : ViewModelBase + public class ViewAViewModel : BindableBase, INavigationAware { private readonly INavigationService _navigationService; @@ -29,15 +29,14 @@ namespace HelloWorld.ViewModels _navigationService.Navigate("ViewB"); } - public override void OnNavigatedFrom(NavigationParameters parameters) + public void OnNavigatedFrom(NavigationParameters parameters) { - base.OnNavigatedFrom(parameters); + } - public override void OnNavigatedTo(NavigationParameters parameters) + public void OnNavigatedTo(NavigationParameters parameters) { - base.OnNavigatedTo(parameters); + } } - } diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/ViewBViewModel.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/ViewModels/ViewBViewModel.cs index 91456e9..6162d52 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/ViewBViewModel.cs +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/ViewModels/ViewBViewModel.cs @@ -1,9 +1,10 @@ using Prism.Commands; +using Prism.Mvvm; using Prism.Navigation; -namespace HelloWorld.ViewModels +namespace ModuleA.ViewModels { - public class ViewBViewModel : ViewModelBase + public class ViewBViewModel : BindableBase, INavigationAware { private readonly INavigationService _navigationService; @@ -28,14 +29,14 @@ namespace HelloWorld.ViewModels _navigationService.GoBack(); } - public override void OnNavigatedFrom(NavigationParameters parameters) + public void OnNavigatedFrom(NavigationParameters parameters) { - base.OnNavigatedFrom(parameters); + } - public override void OnNavigatedTo(NavigationParameters parameters) + public void OnNavigatedTo(NavigationParameters parameters) { - base.OnNavigatedTo(parameters); + } } } diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/ViewCViewModel.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/ViewModels/ViewCViewModel.cs index dcc1944..e43d41f 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/ViewModels/ViewCViewModel.cs +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/ViewModels/ViewCViewModel.cs @@ -1,9 +1,10 @@ using Prism.Commands; +using Prism.Mvvm; using Prism.Navigation; -namespace HelloWorld.ViewModels +namespace ModuleA.ViewModels { - public class ViewCViewModel : ViewModelBase + public class ViewCViewModel : BindableBase, INavigationAware { private readonly INavigationService _navigationService; @@ -28,14 +29,14 @@ namespace HelloWorld.ViewModels _navigationService.Navigate("ViewB"); } - public override void OnNavigatedFrom(NavigationParameters parameters) + public void OnNavigatedFrom(NavigationParameters parameters) { - base.OnNavigatedFrom(parameters); + } - public override void OnNavigatedTo(NavigationParameters parameters) + public void OnNavigatedTo(NavigationParameters parameters) { - base.OnNavigatedTo(parameters); + } } } diff --git a/Sandbox/Xamarin/HelloWorld/ModuleA/Views/MasterNavigation.xaml b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/MasterNavigation.xaml new file mode 100644 index 0000000..1d0c171 --- /dev/null +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/MasterNavigation.xaml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8" ?> +<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="ModuleA.Views.MasterNavigation" + Title="Module A Navigation"> + <StackLayout> + <Button Text="ViewA" Command="{Binding NavigateCommand}" CommandParameter="ViewA?id=A" /> + <Button Text="ViewB" Command="{Binding NavigateCommand}" CommandParameter="ViewB?id=B" /> + <Button Text="ViewC" Command="{Binding NavigateCommand}" CommandParameter="ViewC?id=C" /> + </StackLayout> +</ContentPage>
\ No newline at end of file diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewB.xaml.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/MasterNavigation.xaml.cs index 58aa0bb..09c2913 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewB.xaml.cs +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/MasterNavigation.xaml.cs @@ -1,5 +1,4 @@ -using Prism.Navigation; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -7,11 +6,11 @@ using System.Threading.Tasks; using Xamarin.Forms; -namespace HelloWorld.Views +namespace ModuleA.Views { - public partial class ViewB : ContentPage + public partial class MasterNavigation : ContentPage { - public ViewB() + public MasterNavigation() { InitializeComponent(); } diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewA.xaml b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewA.xaml index 9a3e608..8678ab6 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewA.xaml +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewA.xaml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" - prism:ViewModelLocator.AutowireViewModel="True" - Title="View A" - x:Class="HelloWorld.Views.ViewA"> + xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" + prism:ViewModelLocator.AutowireViewModel="True" + x:Class="ModuleA.Views.ViewA"> <StackLayout> <Label Text="{Binding Title}" VerticalOptions="Center" HorizontalOptions="Center" /> <Button Command="{Binding NavigateCommand}" Text="Navigate" /> diff --git a/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewA.xaml.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewA.xaml.cs new file mode 100644 index 0000000..68f5ac5 --- /dev/null +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewA.xaml.cs @@ -0,0 +1,12 @@ +using Xamarin.Forms; + +namespace ModuleA.Views +{ + public partial class ViewA : ContentPage + { + public ViewA() + { + InitializeComponent(); + } + } +} diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewB.xaml b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewB.xaml index af64c19..b7f5c74 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewB.xaml +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewB.xaml @@ -1,12 +1,14 @@ <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - x:Class="HelloWorld.Views.ViewB" xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" - prism:ViewModelLocator.AutowireViewModel="True" + prism:ViewModelLocator.AutowireViewModel="True" + x:Class="ModuleA.Views.ViewB" Title="View B"> + <StackLayout> <Label Text="{Binding Title}" VerticalOptions="Center" HorizontalOptions="Center" /> <Button Command="{Binding NavigateCommand}" Text="Navigate" /> </StackLayout> + </ContentPage>
\ No newline at end of file diff --git a/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewB.xaml.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewB.xaml.cs new file mode 100644 index 0000000..cef9b6b --- /dev/null +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewB.xaml.cs @@ -0,0 +1,12 @@ +using Xamarin.Forms; + +namespace ModuleA.Views +{ + public partial class ViewB : ContentPage + { + public ViewB() + { + InitializeComponent(); + } + } +} diff --git a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewC.xaml b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewC.xaml index fffa55e..a53d722 100644 --- a/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/ViewC.xaml +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewC.xaml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - x:Class="HelloWorld.Views.ViewC" xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" - prism:ViewModelLocator.AutowireViewModel="True" - Title="View C"> + prism:ViewModelLocator.AutowireViewModel="True" + x:Class="ModuleA.Views.ViewC"> <StackLayout> <Label Text="{Binding Title}" VerticalOptions="Center" HorizontalOptions="Center" /> <Button Command="{Binding NavigateCommand}" Text="Navigate" /> diff --git a/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewC.xaml.cs b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewC.xaml.cs new file mode 100644 index 0000000..1095b53 --- /dev/null +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/Views/ViewC.xaml.cs @@ -0,0 +1,12 @@ +using Xamarin.Forms; + +namespace ModuleA.Views +{ + public partial class ViewC : ContentPage + { + public ViewC() + { + InitializeComponent(); + } + } +} diff --git a/Sandbox/Xamarin/HelloWorld/ModuleA/packages.config b/Sandbox/Xamarin/HelloWorld/ModuleA/packages.config new file mode 100644 index 0000000..c1f4523 --- /dev/null +++ b/Sandbox/Xamarin/HelloWorld/ModuleA/packages.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="CommonServiceLocator" version="1.3" targetFramework="portable45-net45+win8+wp8" /> + <package id="Unity" version="4.0.1" targetFramework="portable45-net45+win8+wp8" /> + <package id="Xamarin.Forms" version="2.0.0.6490" targetFramework="portable45-net45+win8+wp8" /> +</packages>
\ No newline at end of file |