From c755b17c4131bd997e8169fafcfcb87759936e94 Mon Sep 17 00:00:00 2001 From: Jason Jarvis Date: Sun, 17 Apr 2016 23:19:34 -0700 Subject: [PATCH 1/5] Initial work to split ControlCatalog out into Portable implementation and Desktop wrapper. --- Perspex.sln | 116 +++++++--- samples/ControlCatalog.Desktop/App.config | 14 ++ .../ControlCatalog.Desktop.csproj | 123 ++++++++++ samples/ControlCatalog.Desktop/Program.cs | 147 ++++++++++++ .../Properties/AssemblyInfo.cs | 36 +++ .../ControlCatalog.Desktop/packages.config | 4 + samples/ControlCatalog/App.xaml.cs | 12 +- .../ControlCatalog/ControlCatalog.PCL.csproj | 215 ++++++++++++++++++ src/Perspex.Base/Platform/IAssetLoader.cs | 11 + src/Shared/PlatformSupport/AssetLoader.cs | 7 +- 10 files changed, 637 insertions(+), 48 deletions(-) create mode 100644 samples/ControlCatalog.Desktop/App.config create mode 100644 samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj create mode 100644 samples/ControlCatalog.Desktop/Program.cs create mode 100644 samples/ControlCatalog.Desktop/Properties/AssemblyInfo.cs create mode 100644 samples/ControlCatalog.Desktop/packages.config create mode 100644 samples/ControlCatalog/ControlCatalog.PCL.csproj diff --git a/Perspex.sln b/Perspex.sln index 48e1bc66cd..5060a00719 100644 --- a/Perspex.sln +++ b/Perspex.sln @@ -60,6 +60,9 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Markup.Xaml", "src\Markup\Perspex.Markup.Xaml\Perspex.Markup.Xaml.csproj", "{3E53A01A-B331-47F3-B828-4A5717E77A24}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{9B9E3891-2366-4253-A952-D08BCEB71098}" + ProjectSection(SolutionItems) = preProject + samples\ControlCatalog\ControlCatalog.PCL.csproj = samples\ControlCatalog\ControlCatalog.PCL.csproj + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication", "samples\TestApplication\TestApplication.csproj", "{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}" ProjectSection(ProjectDependencies) = postProject @@ -137,8 +140,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.iOSTestApplication" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.LeakTests", "tests\Perspex.LeakTests\Perspex.LeakTests.csproj", "{E1AA3DBF-9056-4530-9376-18119A7A3FFE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog", "samples\ControlCatalog\ControlCatalog.csproj", "{61BEC86C-F307-4295-B5B8-9428610D7D55}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.UnitTests", "tests\Perspex.UnitTests\Perspex.UnitTests.csproj", "{88060192-33D5-4932-B0F9-8BD2763E857D}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Benchmarks", "tests\Perspex.Benchmarks\Perspex.Benchmarks.csproj", "{410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B}" @@ -147,6 +148,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Logging.Serilog", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.DesignerSupport", "src\Perspex.DesignerSupport\Perspex.DesignerSupport.csproj", "{799A7BB5-3C2C-48B6-85A7-406A12C420DA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.PCL", "samples\ControlCatalog\ControlCatalog.PCL.csproj", "{D0A739B9-3C68-4BA6-A328-41606954B6BD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.Desktop", "samples\ControlCatalog.Desktop\ControlCatalog.Desktop.csproj", "{2B888490-D14A-4BCA-AB4B-48676FA93C9B}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution src\Shared\RenderHelpers\RenderHelpers.projitems*{fb05ac90-89ba-4f2f-a924-f37875fb547c}*SharedItemsImports = 4 @@ -349,32 +354,36 @@ Global {3E908F67-5543-4879-A1DC-08EACE79B3CD}.Release|iPhone.Build.0 = Release|Any CPU {3E908F67-5543-4879-A1DC-08EACE79B3CD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {3E908F67-5543-4879-A1DC-08EACE79B3CD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {3E908F67-5543-4879-A1DC-08EACE79B3CD}.Release|x86.ActiveCfg = Release|Any CPU + {3E908F67-5543-4879-A1DC-08EACE79B3CD}.Release|x86.Build.0 = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU + {EC42600F-049B-43FF-AED1-8314D61B2749}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.AppStore|Any CPU.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.AppStore|Any CPU.Build.0 = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.AppStore|iPhone.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.AppStore|iPhone.Build.0 = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU + {EC42600F-049B-43FF-AED1-8314D61B2749}.AppStore|x86.ActiveCfg = Debug|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Debug|Any CPU.Build.0 = Debug|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Debug|iPhone.ActiveCfg = Debug|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Debug|iPhone.Build.0 = Debug|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {EC42600F-049B-43FF-AED1-8314D61B2749}.Debug|x86.ActiveCfg = Debug|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Release|Any CPU.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Release|Any CPU.Build.0 = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Release|iPhone.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Release|iPhone.Build.0 = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {EC42600F-049B-43FF-AED1-8314D61B2749}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {3E908F67-5543-4879-A1DC-08EACE79B3CD}.Release|x86.ActiveCfg = Release|Any CPU - {3E908F67-5543-4879-A1DC-08EACE79B3CD}.Release|x86.Build.0 = Release|Any CPU + {EC42600F-049B-43FF-AED1-8314D61B2749}.Release|x86.ActiveCfg = Release|Any CPU {62024B2D-53EB-4638-B26B-85EEAA54866E}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU {62024B2D-53EB-4638-B26B-85EEAA54866E}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU {62024B2D-53EB-4638-B26B-85EEAA54866E}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU @@ -1578,38 +1587,6 @@ Global {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Release|x86.ActiveCfg = Release|Any CPU {E1AA3DBF-9056-4530-9376-18119A7A3FFE}.Release|x86.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.AppStore|Any CPU.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.AppStore|iPhone.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.AppStore|x86.ActiveCfg = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.AppStore|x86.Build.0 = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Debug|Any CPU.Build.0 = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Debug|iPhone.Build.0 = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Debug|x86.ActiveCfg = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Debug|x86.Build.0 = Debug|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Release|Any CPU.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Release|Any CPU.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Release|iPhone.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Release|iPhone.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Release|x86.ActiveCfg = Release|Any CPU - {61BEC86C-F307-4295-B5B8-9428610D7D55}.Release|x86.Build.0 = Release|Any CPU {88060192-33D5-4932-B0F9-8BD2763E857D}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU {88060192-33D5-4932-B0F9-8BD2763E857D}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU {88060192-33D5-4932-B0F9-8BD2763E857D}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU @@ -1738,6 +1715,70 @@ Global {799A7BB5-3C2C-48B6-85A7-406A12C420DA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {799A7BB5-3C2C-48B6-85A7-406A12C420DA}.Release|x86.ActiveCfg = Release|Any CPU {799A7BB5-3C2C-48B6-85A7-406A12C420DA}.Release|x86.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Ad-Hoc|x86.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.AppStore|Any CPU.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.AppStore|Any CPU.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.AppStore|iPhone.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.AppStore|iPhone.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.AppStore|x86.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.AppStore|x86.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Debug|iPhone.Build.0 = Debug|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Debug|x86.ActiveCfg = Debug|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Debug|x86.Build.0 = Debug|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Release|Any CPU.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Release|iPhone.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Release|iPhone.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Release|x86.ActiveCfg = Release|Any CPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD}.Release|x86.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Ad-Hoc|x86.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.AppStore|Any CPU.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.AppStore|Any CPU.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.AppStore|iPhone.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.AppStore|iPhone.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.AppStore|x86.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.AppStore|x86.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Debug|iPhone.Build.0 = Debug|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Debug|x86.ActiveCfg = Debug|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Debug|x86.Build.0 = Debug|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|Any CPU.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|iPhone.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|iPhone.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|x86.ActiveCfg = Release|Any CPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1780,8 +1821,9 @@ Global {4488AD85-1495-4809-9AA4-DDFE0A48527E} = {0CB0B92E-6CFF-4240-80A5-CCAFE75D91E1} {8C923867-8A8F-4F6B-8B80-47D9E8436166} = {0CB0B92E-6CFF-4240-80A5-CCAFE75D91E1} {E1AA3DBF-9056-4530-9376-18119A7A3FFE} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} - {61BEC86C-F307-4295-B5B8-9428610D7D55} = {9B9E3891-2366-4253-A952-D08BCEB71098} {88060192-33D5-4932-B0F9-8BD2763E857D} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} + {D0A739B9-3C68-4BA6-A328-41606954B6BD} = {9B9E3891-2366-4253-A952-D08BCEB71098} + {2B888490-D14A-4BCA-AB4B-48676FA93C9B} = {9B9E3891-2366-4253-A952-D08BCEB71098} EndGlobalSection EndGlobal diff --git a/samples/ControlCatalog.Desktop/App.config b/samples/ControlCatalog.Desktop/App.config new file mode 100644 index 0000000000..9822b80918 --- /dev/null +++ b/samples/ControlCatalog.Desktop/App.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj b/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj new file mode 100644 index 0000000000..de1ef0ab8f --- /dev/null +++ b/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj @@ -0,0 +1,123 @@ + + + + + Debug + AnyCPU + {2B888490-D14A-4BCA-AB4B-48676FA93C9B} + WinExe + Properties + ControlCatalog.Desktop + ControlCatalog.Desktop + v4.5.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\Serilog.1.5.14\lib\net45\Serilog.dll + True + + + ..\..\packages\Serilog.1.5.14\lib\net45\Serilog.FullNetFx.dll + True + + + + + + + + + + + + + + + + + + + + + {FB05AC90-89BA-4F2F-A924-F37875FB547C} + Perspex.Cairo + + + {54F237D5-A70A-4752-9656-0C70B1A7B047} + Perspex.Gtk + + + {3E53A01A-B331-47F3-B828-4A5717E77A24} + Perspex.Markup.Xaml + + + {6417E941-21BC-467B-A771-0DE389353CE6} + Perspex.Markup + + + {B09B78D8-9B26-48B0-9149-D64A2F120F3F} + Perspex.Base + + + {D2221C82-4A25-4583-9B43-D791E3F6820C} + Perspex.Controls + + + {B61B66A3-B82D-4875-8001-89D3394FE0C9} + Perspex.Logging.Serilog + + + {F1BAA01A-F176-4C6A-B39D-5B40BB1B148F} + Perspex.Styling + + + {3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F} + Perspex.Themes.Default + + + {925DD807-B651-475F-9F7C-CBEB974CE43D} + Perspex.Skia.Desktop + + + {3E908F67-5543-4879-A1DC-08EACE79B3CD} + Perspex.Direct2D1 + + + {811A76CF-1CF6-440F-963B-BBE31BD72A82} + Perspex.Win32 + + + {d0a739b9-3c68-4ba6-a328-41606954b6bd} + ControlCatalog.PCL + + + + + \ No newline at end of file diff --git a/samples/ControlCatalog.Desktop/Program.cs b/samples/ControlCatalog.Desktop/Program.cs new file mode 100644 index 0000000000..3fa5d32ae3 --- /dev/null +++ b/samples/ControlCatalog.Desktop/Program.cs @@ -0,0 +1,147 @@ +using Perspex.Logging.Serilog; +using Serilog; +using System; +using System.Linq; +using Perspex; +using System.Reflection; +using Perspex.Platform; + + +// Not sure where the best home for this is +namespace Perspex +{ + public static class SharedApplicationExtensions + { + // For true Portable apps we need to select the PCL assembly NOT the host platform exe. Unfortunately + // Win32 subsystem registers one by default (the wrong one) and so this can override that. + // + public static AppT UseAssetAssembly(this AppT app, Assembly assembly) where AppT : Application + { + // Asset loading searches our own assembly? + PerspexLocator.CurrentMutable.GetService().SetDefaultAssembly(assembly); + return app; + } + } +} + +namespace ControlCatalog +{ + internal class Program + { + static void Main(string[] args) + { + InitializeLogging(); + + new App() + .ConfigureRenderSystem(args) + .UseAssetAssembly(typeof(App).Assembly) + .LoadFromXaml() + .RunWithMainWindow(); + } + + // This will be made into a runtime configuration extension soon! + private static void InitializeLogging() + { +#if DEBUG + SerilogLogger.Initialize(new LoggerConfiguration() + .MinimumLevel.Warning() + .WriteTo.Trace(outputTemplate: "{Area}: {Message}") + .CreateLogger()); +#endif + } + + } + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Experimental: Would like to move this into a shared location once I figure out the best place for it + // considering all common libraries are PCL and do not have access to Environment.OSVersion.Platform + // nor do they have access to the platform specific render/subsystem extensions. + // + // Perhaps via DI we register each system with a priority/rank + // + public static class RenderSystemExtensions + { + [Flags] + enum RenderSystem + { + None = 0, + GTK = 1, + Skia = 2, + Direct2D = 4 + }; + + /// + /// Default (Optimal) render system for a particular platform + /// + /// + private static RenderSystem DefaultRenderSystem() + { + switch (Environment.OSVersion.Platform) + { + case PlatformID.MacOSX: + return RenderSystem.GTK; + + case PlatformID.Unix: + return RenderSystem.GTK; + + case PlatformID.Win32Windows: + return RenderSystem.Direct2D; + } + + return RenderSystem.None; + } + + /// + /// Returns an array of avalidable rendering systems in priority order + /// + /// + private static RenderSystem[] AvailableRenderSystems() + { + switch (Environment.OSVersion.Platform) + { + case PlatformID.MacOSX: + return new RenderSystem[] { RenderSystem.GTK, RenderSystem.Skia }; + + case PlatformID.Unix: + return new RenderSystem[] { RenderSystem.GTK, RenderSystem.Skia }; + + case PlatformID.Win32Windows: + return new RenderSystem[] { RenderSystem.Direct2D, RenderSystem.Skia, RenderSystem.GTK }; + } + + return new RenderSystem[0]; + } + + /// + /// Selects the optimal render system for desktop platforms. Supports cmd line overrides + /// + /// + /// + public static TApp ConfigureRenderSystem(this TApp app, string[] args) where TApp : Application + { + // So this all works great under Windows where it can support + // ALL configurations. But on OSX/Unix we cannot use Direct2D + // + if (args.Contains("--gtk") || DefaultRenderSystem() == RenderSystem.GTK) + { + app.UseGtk(); + app.UseCairo(); + } + else + { + app.UseWin32(); + + if (args.Contains("--skia") || DefaultRenderSystem() == RenderSystem.Skia) + { + app.UseSkia(); + } + else + { + app.UseDirect2D(); + } + } + + return app; + } + } +} diff --git a/samples/ControlCatalog.Desktop/Properties/AssemblyInfo.cs b/samples/ControlCatalog.Desktop/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..2377b91393 --- /dev/null +++ b/samples/ControlCatalog.Desktop/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("ControlCatalog.Desktop")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ControlCatalog.Desktop")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2b888490-d14a-4bca-ab4b-48676fa93c9b")] + +// 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/samples/ControlCatalog.Desktop/packages.config b/samples/ControlCatalog.Desktop/packages.config new file mode 100644 index 0000000000..b3abe6f487 --- /dev/null +++ b/samples/ControlCatalog.Desktop/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/samples/ControlCatalog/App.xaml.cs b/samples/ControlCatalog/App.xaml.cs index 5ee9373edb..4cd4cea0ee 100644 --- a/samples/ControlCatalog/App.xaml.cs +++ b/samples/ControlCatalog/App.xaml.cs @@ -1,18 +1,12 @@ -using System; -using System.Linq; -using Perspex; -using Perspex.Controls; -using Perspex.Diagnostics; -using Perspex.Markup.Xaml; -using Perspex.Logging.Serilog; -using Serilog; +using Perspex; + namespace ControlCatalog { // Eventually we should move this into a PCL library so we can access // from mobile platforms // - class App : Application + public class App : Application { public App() { diff --git a/samples/ControlCatalog/ControlCatalog.PCL.csproj b/samples/ControlCatalog/ControlCatalog.PCL.csproj new file mode 100644 index 0000000000..5ed85322a0 --- /dev/null +++ b/samples/ControlCatalog/ControlCatalog.PCL.csproj @@ -0,0 +1,215 @@ + + + + + 10.0 + Debug + AnyCPU + {D0A739B9-3C68-4BA6-A328-41606954B6BD} + Library + Properties + ControlCatalog + ControlCatalog + en-US + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile7 + v4.5 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + + + App.xaml + + + MainWindow.xaml + + + BorderPage.xaml + + + ButtonPage.xaml + + + CanvasPage.xaml + + + CarouselPage.xaml + + + CheckBoxPage.xaml + + + DropDownPage.xaml + + + ExpanderPage.xaml + + + ImagePage.xaml + + + LayoutTransformControlPage.xaml + + + MenuPage.xaml + + + RadioButtonPage.xaml + + + SliderPage.xaml + + + TextBoxPage.xaml + + + ToolTipPage.xaml + + + + + + + + + + + + Designer + + + + + {3E53A01A-B331-47F3-B828-4A5717E77A24} + Perspex.Markup.Xaml + + + {6417E941-21BC-467B-A771-0DE389353CE6} + Perspex.Markup + + + {D211E587-D8BC-45B9-95A4-F297C8FA5200} + Perspex.Animation + + + {B09B78D8-9B26-48B0-9149-D64A2F120F3F} + Perspex.Base + + + {D2221C82-4A25-4583-9B43-D791E3F6820C} + Perspex.Controls + + + {7062AE20-5DCC-4442-9645-8195BDECE63E} + Perspex.Diagnostics + + + {5FB2B005-0A7F-4DAD-ADD4-3ED01444E63D} + Perspex.HtmlRenderer + + + {62024B2D-53EB-4638-B26B-85EEAA54866E} + Perspex.Input + + + {6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B} + Perspex.Interactivity + + + {42472427-4774-4C81-8AFF-9F27B8E31721} + Perspex.Layout + + + {6417B24E-49C2-4985-8DB2-3AB9D898EC91} + Perspex.ReactiveUI + + + {EB582467-6ABB-43A1-B052-E981BA910E3A} + Perspex.SceneGraph + + + {F1BAA01A-F176-4C6A-B39D-5B40BB1B148F} + Perspex.Styling + + + {3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F} + Perspex.Themes.Default + + + + + \ No newline at end of file diff --git a/src/Perspex.Base/Platform/IAssetLoader.cs b/src/Perspex.Base/Platform/IAssetLoader.cs index 9594e7e021..00f9d7e4d3 100644 --- a/src/Perspex.Base/Platform/IAssetLoader.cs +++ b/src/Perspex.Base/Platform/IAssetLoader.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using System.Reflection; namespace Perspex.Platform { @@ -11,6 +12,16 @@ namespace Perspex.Platform /// public interface IAssetLoader { + /// + /// We need a way to override the default assembly selected by the host platform + /// because right now it is selecting the wrong one for PCL based Apps. The + /// AssetLoader needs a refactor cause right now it lives in 3+ platforms which + /// can all be loaded on Windows. + /// + /// + void SetDefaultAssembly(Assembly asm); + + /// /// Checks if an asset with the specified URI exists. /// diff --git a/src/Shared/PlatformSupport/AssetLoader.cs b/src/Shared/PlatformSupport/AssetLoader.cs index c70133efaf..458af2a9a1 100644 --- a/src/Shared/PlatformSupport/AssetLoader.cs +++ b/src/Shared/PlatformSupport/AssetLoader.cs @@ -38,7 +38,7 @@ namespace Perspex.Shared.PlatformSupport private static readonly Dictionary AssemblyNameCache = new Dictionary(); - private readonly AssemblyDescriptor _defaultAssembly; + private AssemblyDescriptor _defaultAssembly; public AssetLoader(Assembly assembly = null) { @@ -47,8 +47,11 @@ namespace Perspex.Shared.PlatformSupport if (assembly != null) _defaultAssembly = new AssemblyDescriptor(assembly); } - + public void SetDefaultAssembly(Assembly assembly) + { + _defaultAssembly = new AssemblyDescriptor(assembly); + } AssemblyDescriptor GetAssembly(string name) { From c961c8f9755163c59f53be876bc872dc1bbac8bf Mon Sep 17 00:00:00 2001 From: Jason Jarvis Date: Mon, 18 Apr 2016 00:16:54 -0700 Subject: [PATCH 2/5] Added iOS host for ControlCatalog PCL. Had to forcibly reference Themes.Default to get Xamarin runtime to load it properly. --- Perspex.sln | 27 +++ samples/ControlCatalog.iOS/AppDelegate.cs | 35 ++++ .../ControlCatalog.iOS.csproj | 188 ++++++++++++++++++ samples/ControlCatalog.iOS/Entitlements.plist | 5 + samples/ControlCatalog.iOS/Info.plist | 42 ++++ samples/ControlCatalog.iOS/Main.cs | 15 ++ .../Properties/AssemblyInfo.cs | 36 ++++ .../Resources/LaunchScreen.xib | 43 ++++ samples/ControlCatalog.iOS/packages.config | 8 + samples/ControlCatalog/MainWindow.xaml.cs | 6 + src/Shared/PlatformSupport/AssetLoader.cs | 16 +- 11 files changed, 417 insertions(+), 4 deletions(-) create mode 100644 samples/ControlCatalog.iOS/AppDelegate.cs create mode 100644 samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj create mode 100644 samples/ControlCatalog.iOS/Entitlements.plist create mode 100644 samples/ControlCatalog.iOS/Info.plist create mode 100644 samples/ControlCatalog.iOS/Main.cs create mode 100644 samples/ControlCatalog.iOS/Properties/AssemblyInfo.cs create mode 100644 samples/ControlCatalog.iOS/Resources/LaunchScreen.xib create mode 100644 samples/ControlCatalog.iOS/packages.config diff --git a/Perspex.sln b/Perspex.sln index 5060a00719..a7b9667d90 100644 --- a/Perspex.sln +++ b/Perspex.sln @@ -152,6 +152,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.PCL", "sampl EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.Desktop", "samples\ControlCatalog.Desktop\ControlCatalog.Desktop.csproj", "{2B888490-D14A-4BCA-AB4B-48676FA93C9B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.iOS", "samples\ControlCatalog.iOS\ControlCatalog.iOS.csproj", "{57E0455D-D565-44BB-B069-EE1AA20F8337}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution src\Shared\RenderHelpers\RenderHelpers.projitems*{fb05ac90-89ba-4f2f-a924-f37875fb547c}*SharedItemsImports = 4 @@ -1779,6 +1781,30 @@ Global {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|x86.ActiveCfg = Release|Any CPU {2B888490-D14A-4BCA-AB4B-48676FA93C9B}.Release|x86.Build.0 = Release|Any CPU + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.AppStore|iPhone.ActiveCfg = AppStore|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.AppStore|iPhone.Build.0 = AppStore|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337}.AppStore|x86.ActiveCfg = AppStore|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Debug|Any CPU.ActiveCfg = Debug|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Debug|iPhone.ActiveCfg = Debug|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Debug|iPhone.Build.0 = Debug|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Debug|x86.ActiveCfg = Debug|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Release|Any CPU.ActiveCfg = Release|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Release|iPhone.ActiveCfg = Release|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Release|iPhone.Build.0 = Release|iPhone + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337}.Release|x86.ActiveCfg = Release|iPhone EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1825,5 +1851,6 @@ Global {410AC439-81A1-4EB5-B5E9-6A7FC6B77F4B} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {D0A739B9-3C68-4BA6-A328-41606954B6BD} = {9B9E3891-2366-4253-A952-D08BCEB71098} {2B888490-D14A-4BCA-AB4B-48676FA93C9B} = {9B9E3891-2366-4253-A952-D08BCEB71098} + {57E0455D-D565-44BB-B069-EE1AA20F8337} = {9B9E3891-2366-4253-A952-D08BCEB71098} EndGlobalSection EndGlobal diff --git a/samples/ControlCatalog.iOS/AppDelegate.cs b/samples/ControlCatalog.iOS/AppDelegate.cs new file mode 100644 index 0000000000..68d53f9bf5 --- /dev/null +++ b/samples/ControlCatalog.iOS/AppDelegate.cs @@ -0,0 +1,35 @@ +using Foundation; +using UIKit; +using Perspex; + +namespace ControlCatalog +{ + // The UIApplicationDelegate for the application. This class is responsible for launching the + // User Interface of the application, as well as listening (and optionally responding) to + // application events from iOS. + [Register("AppDelegate")] + public partial class AppDelegate : UIApplicationDelegate + { + // + // This method is invoked when the application has loaded and is ready to run. In this + // method you should instantiate the window, load the UI into it and then make the window + // visible. + // + // You have 17 seconds to return from this method, or iOS will terminate your application. + // + public override bool FinishedLaunching(UIApplication uiapp, NSDictionary options) + { + new App() + .UseiOS() + .UseSkiaViewHost() + .UseSkia() + .UseAssetAssembly(typeof(App).Assembly) + .LoadFromXaml() + .RunWithMainWindow(); + + return true; + } + } + + +} \ No newline at end of file diff --git a/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj b/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj new file mode 100644 index 0000000000..dc724bab11 --- /dev/null +++ b/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj @@ -0,0 +1,188 @@ + + + + Debug + iPhoneSimulator + {57E0455D-D565-44BB-B069-EE1AA20F8337} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Exe + ControlCatalog.iOS + Resources + ControlCatalogiOS + + + true + full + false + bin\iPhoneSimulator\Debug + DEBUG + prompt + 4 + false + i386 + None + true + + + none + true + bin\iPhoneSimulator\Release + prompt + 4 + None + i386 + false + + + true + full + false + bin\iPhone\Debug + DEBUG + prompt + 4 + false + ARMv7, ARM64 + Entitlements.plist + iPhone Developer + true + + + none + true + bin\iPhone\Release + prompt + 4 + Entitlements.plist + ARMv7, ARM64 + false + iPhone Developer + + + none + True + bin\iPhone\Ad-Hoc + prompt + 4 + False + ARMv7, ARM64 + Entitlements.plist + True + Automatic:AdHoc + iPhone Distribution + + + none + True + bin\iPhone\AppStore + prompt + 4 + False + ARMv7, ARM64 + Entitlements.plist + Automatic:AppStore + iPhone Distribution + + + + + + + + + + + + + + ..\..\packages\Rx-Core.2.2.5\lib\portable-windows8+net45+wp8\System.Reactive.Core.dll + True + + + ..\..\packages\Rx-Interfaces.2.2.5\lib\portable-windows8+net45+wp8\System.Reactive.Interfaces.dll + True + + + ..\..\packages\Rx-Linq.2.2.5\lib\portable-windows8+net45+wp8\System.Reactive.Linq.dll + True + + + ..\..\packages\Rx-PlatformServices.2.2.5\lib\portable-windows8+net45+wp8\System.Reactive.PlatformServices.dll + True + + + + + + + + {4488AD85-1495-4809-9AA4-DDFE0A48527E} + Perspex.iOS + false + false + + + {3E53A01A-B331-47F3-B828-4A5717E77A24} + Perspex.Markup.Xaml + + + {6417E941-21BC-467B-A771-0DE389353CE6} + Perspex.Markup + + + {D211E587-D8BC-45B9-95A4-F297C8FA5200} + Perspex.Animation + + + {B09B78D8-9B26-48B0-9149-D64A2F120F3F} + Perspex.Base + + + {D2221C82-4A25-4583-9B43-D791E3F6820C} + Perspex.Controls + + + {7062AE20-5DCC-4442-9645-8195BDECE63E} + Perspex.Diagnostics + + + {5FB2B005-0A7F-4DAD-ADD4-3ED01444E63D} + Perspex.HtmlRenderer + + + {62024B2D-53EB-4638-B26B-85EEAA54866E} + Perspex.Input + + + {6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B} + Perspex.Interactivity + + + {42472427-4774-4C81-8AFF-9F27B8E31721} + Perspex.Layout + + + {EB582467-6ABB-43A1-B052-E981BA910E3A} + Perspex.SceneGraph + + + {F1BAA01A-F176-4C6A-B39D-5B40BB1B148F} + Perspex.Styling + + + {3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F} + Perspex.Themes.Default + + + {47BE08A7-5985-410B-9FFC-2264B8EA595F} + Perspex.Skia.iOS + false + false + + + {d0a739b9-3c68-4ba6-a328-41606954b6bd} + ControlCatalog.PCL + + + + \ No newline at end of file diff --git a/samples/ControlCatalog.iOS/Entitlements.plist b/samples/ControlCatalog.iOS/Entitlements.plist new file mode 100644 index 0000000000..0c67376eba --- /dev/null +++ b/samples/ControlCatalog.iOS/Entitlements.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/samples/ControlCatalog.iOS/Info.plist b/samples/ControlCatalog.iOS/Info.plist new file mode 100644 index 0000000000..216fd9c333 --- /dev/null +++ b/samples/ControlCatalog.iOS/Info.plist @@ -0,0 +1,42 @@ + + + + + CFBundleDisplayName + ControlCatalog.iOS + CFBundleIdentifier + com.companyname.ControlCatalog.iOS + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + MinimumOSVersion + 8.0 + UIDeviceFamily + + 1 + 2 + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/samples/ControlCatalog.iOS/Main.cs b/samples/ControlCatalog.iOS/Main.cs new file mode 100644 index 0000000000..64c6298fca --- /dev/null +++ b/samples/ControlCatalog.iOS/Main.cs @@ -0,0 +1,15 @@ +using UIKit; + +namespace ControlCatalog.iOS +{ + public class Application + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, "AppDelegate"); + } + } +} \ No newline at end of file diff --git a/samples/ControlCatalog.iOS/Properties/AssemblyInfo.cs b/samples/ControlCatalog.iOS/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..88c6abb1dd --- /dev/null +++ b/samples/ControlCatalog.iOS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("ControlCatalog.iOS")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ControlCatalog.iOS")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("57e0455d-d565-44bb-b069-ee1aa20f8337")] + +// 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/samples/ControlCatalog.iOS/Resources/LaunchScreen.xib b/samples/ControlCatalog.iOS/Resources/LaunchScreen.xib new file mode 100644 index 0000000000..e370a5ea74 --- /dev/null +++ b/samples/ControlCatalog.iOS/Resources/LaunchScreen.xib @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/ControlCatalog.iOS/packages.config b/samples/ControlCatalog.iOS/packages.config new file mode 100644 index 0000000000..bfadbb7b80 --- /dev/null +++ b/samples/ControlCatalog.iOS/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/samples/ControlCatalog/MainWindow.xaml.cs b/samples/ControlCatalog/MainWindow.xaml.cs index 62949a9abd..996198a4a8 100644 --- a/samples/ControlCatalog/MainWindow.xaml.cs +++ b/samples/ControlCatalog/MainWindow.xaml.cs @@ -14,6 +14,12 @@ namespace ControlCatalog private void InitializeComponent() { + // iOS seems to be stripping out this assembly for some reason, so + // going to force link it + var theme = new Perspex.Themes.Default.DefaultTheme(); + theme.FindResource("test"); + + this.LoadFromXaml(); } } diff --git a/src/Shared/PlatformSupport/AssetLoader.cs b/src/Shared/PlatformSupport/AssetLoader.cs index 458af2a9a1..0072b418fc 100644 --- a/src/Shared/PlatformSupport/AssetLoader.cs +++ b/src/Shared/PlatformSupport/AssetLoader.cs @@ -56,13 +56,21 @@ namespace Perspex.Shared.PlatformSupport AssemblyDescriptor GetAssembly(string name) { if (name == null) + { return _defaultAssembly; + } + AssemblyDescriptor rv; if (!AssemblyNameCache.TryGetValue(name, out rv)) - AssemblyNameCache[name] = rv = - new AssemblyDescriptor(AppDomain.CurrentDomain.GetAssemblies() - .FirstOrDefault(a => a.GetName().Name == name) - ?? Assembly.Load(name)); + { + var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies(); + var match = loadedAssemblies.FirstOrDefault(a => a.GetName().Name == name); + if (match != null) + { + AssemblyNameCache[name] = rv = new AssemblyDescriptor(Assembly.Load(name)); + } + } + return rv; } From 309dabe0c281f0df8f1d1a3f8ffd867a8dcf8fa5 Mon Sep 17 00:00:00 2001 From: Jason Jarvis Date: Mon, 18 Apr 2016 21:33:40 -0700 Subject: [PATCH 3/5] Fix Asset DLL loading on non-iOS platforms that I broke. --- src/Shared/PlatformSupport/AssetLoader.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Shared/PlatformSupport/AssetLoader.cs b/src/Shared/PlatformSupport/AssetLoader.cs index 0072b418fc..86a4bee418 100644 --- a/src/Shared/PlatformSupport/AssetLoader.cs +++ b/src/Shared/PlatformSupport/AssetLoader.cs @@ -67,7 +67,15 @@ namespace Perspex.Shared.PlatformSupport var match = loadedAssemblies.FirstOrDefault(a => a.GetName().Name == name); if (match != null) { + AssemblyNameCache[name] = rv = new AssemblyDescriptor(match); + } + else + { + // iOS does not support loading assemblies dynamically! + // +#if !__IOS__ AssemblyNameCache[name] = rv = new AssemblyDescriptor(Assembly.Load(name)); +#endif } } From c79c383450497016b659c13a77cd82b52763ac58 Mon Sep 17 00:00:00 2001 From: Jason Jarvis Date: Mon, 18 Apr 2016 21:38:41 -0700 Subject: [PATCH 4/5] Replaced the contents of ControlCatalog.csproj with that from ControlCatalog.PCL and swapped all references. Removed temporary PCL version. --- Perspex.sln | 4 +- .../ControlCatalog.Desktop.csproj | 4 +- .../ControlCatalog.iOS.csproj | 4 +- .../ControlCatalog/ControlCatalog.PCL.csproj | 215 -------------- samples/ControlCatalog/ControlCatalog.csproj | 275 +++++++----------- samples/ControlCatalog/MainWindow.xaml.cs | 7 +- 6 files changed, 114 insertions(+), 395 deletions(-) delete mode 100644 samples/ControlCatalog/ControlCatalog.PCL.csproj diff --git a/Perspex.sln b/Perspex.sln index a7b9667d90..a6b3fc1e68 100644 --- a/Perspex.sln +++ b/Perspex.sln @@ -61,7 +61,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Markup.Xaml", "src\ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{9B9E3891-2366-4253-A952-D08BCEB71098}" ProjectSection(SolutionItems) = preProject - samples\ControlCatalog\ControlCatalog.PCL.csproj = samples\ControlCatalog\ControlCatalog.PCL.csproj + samples\ControlCatalog\ControlCatalog.csproj = samples\ControlCatalog\ControlCatalog.csproj EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication", "samples\TestApplication\TestApplication.csproj", "{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}" @@ -148,7 +148,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Logging.Serilog", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.DesignerSupport", "src\Perspex.DesignerSupport\Perspex.DesignerSupport.csproj", "{799A7BB5-3C2C-48B6-85A7-406A12C420DA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.PCL", "samples\ControlCatalog\ControlCatalog.PCL.csproj", "{D0A739B9-3C68-4BA6-A328-41606954B6BD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog", "samples\ControlCatalog\ControlCatalog.csproj", "{D0A739B9-3C68-4BA6-A328-41606954B6BD}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlCatalog.Desktop", "samples\ControlCatalog.Desktop\ControlCatalog.Desktop.csproj", "{2B888490-D14A-4BCA-AB4B-48676FA93C9B}" EndProject diff --git a/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj b/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj index de1ef0ab8f..6cbf41ebbd 100644 --- a/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj +++ b/samples/ControlCatalog.Desktop/ControlCatalog.Desktop.csproj @@ -107,9 +107,9 @@ {811A76CF-1CF6-440F-963B-BBE31BD72A82} Perspex.Win32 - + {d0a739b9-3c68-4ba6-a328-41606954b6bd} - ControlCatalog.PCL + ControlCatalog diff --git a/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj b/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj index dc724bab11..d66671c9b9 100644 --- a/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj +++ b/samples/ControlCatalog.iOS/ControlCatalog.iOS.csproj @@ -179,9 +179,9 @@ false false - + {d0a739b9-3c68-4ba6-a328-41606954b6bd} - ControlCatalog.PCL + ControlCatalog diff --git a/samples/ControlCatalog/ControlCatalog.PCL.csproj b/samples/ControlCatalog/ControlCatalog.PCL.csproj deleted file mode 100644 index 5ed85322a0..0000000000 --- a/samples/ControlCatalog/ControlCatalog.PCL.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - 10.0 - Debug - AnyCPU - {D0A739B9-3C68-4BA6-A328-41606954B6BD} - Library - Properties - ControlCatalog - ControlCatalog - en-US - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Profile7 - v4.5 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - - - App.xaml - - - MainWindow.xaml - - - BorderPage.xaml - - - ButtonPage.xaml - - - CanvasPage.xaml - - - CarouselPage.xaml - - - CheckBoxPage.xaml - - - DropDownPage.xaml - - - ExpanderPage.xaml - - - ImagePage.xaml - - - LayoutTransformControlPage.xaml - - - MenuPage.xaml - - - RadioButtonPage.xaml - - - SliderPage.xaml - - - TextBoxPage.xaml - - - ToolTipPage.xaml - - - - - - - - - - - - Designer - - - - - {3E53A01A-B331-47F3-B828-4A5717E77A24} - Perspex.Markup.Xaml - - - {6417E941-21BC-467B-A771-0DE389353CE6} - Perspex.Markup - - - {D211E587-D8BC-45B9-95A4-F297C8FA5200} - Perspex.Animation - - - {B09B78D8-9B26-48B0-9149-D64A2F120F3F} - Perspex.Base - - - {D2221C82-4A25-4583-9B43-D791E3F6820C} - Perspex.Controls - - - {7062AE20-5DCC-4442-9645-8195BDECE63E} - Perspex.Diagnostics - - - {5FB2B005-0A7F-4DAD-ADD4-3ED01444E63D} - Perspex.HtmlRenderer - - - {62024B2D-53EB-4638-B26B-85EEAA54866E} - Perspex.Input - - - {6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B} - Perspex.Interactivity - - - {42472427-4774-4C81-8AFF-9F27B8E31721} - Perspex.Layout - - - {6417B24E-49C2-4985-8DB2-3AB9D898EC91} - Perspex.ReactiveUI - - - {EB582467-6ABB-43A1-B052-E981BA910E3A} - Perspex.SceneGraph - - - {F1BAA01A-F176-4C6A-B39D-5B40BB1B148F} - Perspex.Styling - - - {3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F} - Perspex.Themes.Default - - - - - \ No newline at end of file diff --git a/samples/ControlCatalog/ControlCatalog.csproj b/samples/ControlCatalog/ControlCatalog.csproj index 590230e7a2..5ed85322a0 100644 --- a/samples/ControlCatalog/ControlCatalog.csproj +++ b/samples/ControlCatalog/ControlCatalog.csproj @@ -2,20 +2,21 @@ + 10.0 Debug AnyCPU - {61BEC86C-F307-4295-B5B8-9428610D7D55} - WinExe + {D0A739B9-3C68-4BA6-A328-41606954B6BD} + Library Properties ControlCatalog ControlCatalog - v4.5 + en-US 512 - true - + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile7 + v4.5 - AnyCPU true full false @@ -25,7 +26,6 @@ 4 - AnyCPU pdbonly true bin\Release\ @@ -33,26 +33,56 @@ prompt 4 - - - - - ..\..\packages\Serilog.1.5.14\lib\net45\Serilog.dll - True - - - ..\..\packages\Serilog.1.5.14\lib\net45\Serilog.FullNetFx.dll - True - - - - - - - - - + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + @@ -61,217 +91,120 @@ MainWindow.xaml - - ImagePage.xaml - - - ExpanderPage.xaml - - - RadioButtonPage.xaml - - - MenuPage.xaml + + BorderPage.xaml - - ToolTipPage.xaml + + ButtonPage.xaml - - TextBoxPage.xaml + + CanvasPage.xaml - - LayoutTransformControlPage.xaml + + CarouselPage.xaml CheckBoxPage.xaml - - BorderPage.xaml + + DropDownPage.xaml - - CarouselPage.xaml + + ExpanderPage.xaml - - CanvasPage.xaml + + ImagePage.xaml - - ButtonPage.xaml + + LayoutTransformControlPage.xaml - - DropDownPage.xaml + + MenuPage.xaml + + + RadioButtonPage.xaml SliderPage.xaml - + + TextBoxPage.xaml + + + ToolTipPage.xaml + - - - Designer - - - Designer - + + + + + + Designer - - Designer - - - Designer - - - Designer - - - Designer - - - - - Designer - - - Designer - - - {fb05ac90-89ba-4f2f-a924-f37875fb547c} - Perspex.Cairo - - - {54f237d5-a70a-4752-9656-0c70b1a7b047} - Perspex.Gtk - - {3e53a01a-b331-47f3-b828-4a5717e77a24} + {3E53A01A-B331-47F3-B828-4A5717E77A24} Perspex.Markup.Xaml - {6417e941-21bc-467b-a771-0de389353ce6} + {6417E941-21BC-467B-A771-0DE389353CE6} Perspex.Markup - {d211e587-d8bc-45b9-95a4-f297c8fa5200} + {D211E587-D8BC-45B9-95A4-F297C8FA5200} Perspex.Animation - {b09b78d8-9b26-48b0-9149-d64a2f120f3f} + {B09B78D8-9B26-48B0-9149-D64A2F120F3F} Perspex.Base - {d2221c82-4a25-4583-9b43-d791e3f6820c} + {D2221C82-4A25-4583-9B43-D791E3F6820C} Perspex.Controls - - {799a7bb5-3c2c-48b6-85a7-406a12c420da} - Perspex.DesignerSupport - - {7062ae20-5dcc-4442-9645-8195bdece63e} + {7062AE20-5DCC-4442-9645-8195BDECE63E} Perspex.Diagnostics - {5fb2b005-0a7f-4dad-add4-3ed01444e63d} + {5FB2B005-0A7F-4DAD-ADD4-3ED01444E63D} Perspex.HtmlRenderer - {62024b2d-53eb-4638-b26b-85eeaa54866e} + {62024B2D-53EB-4638-B26B-85EEAA54866E} Perspex.Input - {6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b} + {6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B} Perspex.Interactivity - {42472427-4774-4c81-8aff-9f27b8e31721} + {42472427-4774-4C81-8AFF-9F27B8E31721} Perspex.Layout - - {b61b66a3-b82d-4875-8001-89d3394fe0c9} - Perspex.Logging.Serilog - - {6417b24e-49c2-4985-8db2-3ab9d898ec91} + {6417B24E-49C2-4985-8DB2-3AB9D898EC91} Perspex.ReactiveUI - {eb582467-6abb-43a1-b052-e981ba910e3a} + {EB582467-6ABB-43A1-B052-E981BA910E3A} Perspex.SceneGraph - {f1baa01a-f176-4c6a-b39d-5b40bb1b148f} + {F1BAA01A-F176-4C6A-B39D-5B40BB1B148F} Perspex.Styling - {3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f} + {3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F} Perspex.Themes.Default - - {925dd807-b651-475f-9f7c-cbeb974ce43d} - Perspex.Skia.Desktop - - - {3e908f67-5543-4879-a1dc-08eace79b3cd} - Perspex.Direct2D1 - - - {811a76cf-1cf6-440f-963b-bbe31bd72a82} - Perspex.Win32 - - - - - - - - - - - - Designer - - - - - Designer - - - - - Designer - - - - - Designer - - - - - PreserveNewest - - - - - Designer - - - - - Designer - - - - - Designer - - +