├── .gitignore ├── LICENSE.txt ├── README.md ├── Sample ├── Sample.Droid │ ├── Assets │ │ └── AboutAssets.txt │ ├── MainActivity.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── AboutResources.txt │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ │ └── icon.png │ │ ├── drawable-xxhdpi │ │ │ └── icon.png │ │ ├── drawable │ │ │ └── icon.png │ │ ├── layout │ │ │ ├── Tabbar.axml │ │ │ └── Toolbar.axml │ │ └── values │ │ │ └── styles.xml │ ├── Sample.Droid.csproj │ └── packages.config ├── Sample.iOS │ ├── AppDelegate.cs │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── Resources │ │ ├── Images.xcassets │ │ │ └── AppIcons.appiconset │ │ │ │ └── Contents.json │ │ ├── LaunchScreen.xib │ │ └── icon.png │ ├── Sample.iOS.csproj │ └── packages.config ├── Sample.sln └── Sample │ ├── App.xaml │ ├── App.xaml.cs │ ├── Resources │ ├── colours.svg │ ├── flower.jpg │ ├── icon.png │ ├── ios-star.svg │ └── tiger.svg │ ├── Sample.csproj │ ├── ViewModels │ └── MainPageViewModel.cs │ └── Views │ ├── MainPage.xaml │ └── MainPage.xaml.cs ├── SvgImageSource.Droid ├── Properties │ └── AssemblyInfo.cs ├── Resources │ ├── AboutResources.txt │ └── values │ │ └── Strings.xml ├── SvgImage.cs ├── SvgImageSource.Droid.csproj ├── SvgImageSourceHandler.cs └── packages.config ├── SvgImageSource.iOS ├── Properties │ └── AssemblyInfo.cs ├── SvgImage.cs ├── SvgImageSource.iOS.csproj ├── SvgImageSourceHandler.cs └── packages.config ├── SvgImageSource.sln ├── SvgImageSource ├── Properties │ └── AssemblyInfo.cs ├── StreamWrapper.cs ├── SvgImageSource.cs ├── SvgImageSource.csproj └── SvgUtility.cs └── nuget ├── AzurePipelines.nuspec ├── SvgImageSource_mac.nuspec ├── nuget.exe └── pack.sh /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | .vs/ 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.sln.docstates 10 | *.userprefs 11 | 12 | # ignore Xamarin.Android Resource.Designer.cs files 13 | **/*.Droid/**/[Rr]esource.[Dd]esigner.cs 14 | **/*.Android/**/[Rr]esource.[Dd]esigner.cs 15 | **/Android/**/[Rr]esource.[Dd]esigner.cs 16 | 17 | # Xamarin Components 18 | Components/ 19 | 20 | # Build results 21 | [Dd]ebug/ 22 | [Dd]ebugPublic/ 23 | [Rr]elease/ 24 | x64/ 25 | build/ 26 | bld/ 27 | [Bb]in/ 28 | [Oo]bj/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | #NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | *_i.c 44 | *_p.c 45 | *_i.h 46 | *.ilk 47 | *.meta 48 | *.obj 49 | *.pch 50 | *.pdb 51 | *.pgc 52 | *.pgd 53 | *.rsp 54 | *.sbr 55 | *.tlb 56 | *.tli 57 | *.tlh 58 | *.tmp 59 | *.tmp_proj 60 | *.log 61 | *.vspscc 62 | *.vssscc 63 | .builds 64 | *.pidb 65 | *.svclog 66 | *.scc 67 | 68 | # Chutzpah Test files 69 | _Chutzpah* 70 | 71 | # Visual C++ cache files 72 | ipch/ 73 | *.aps 74 | *.ncb 75 | *.opensdf 76 | *.sdf 77 | *.cachefile 78 | 79 | # Visual Studio profiler 80 | *.psess 81 | *.vsp 82 | *.vspx 83 | 84 | # TFS 2012 Local Workspace 85 | $tf/ 86 | 87 | # Guidance Automation Toolkit 88 | *.gpState 89 | 90 | # ReSharper is a .NET coding add-in 91 | _ReSharper*/ 92 | *.[Rr]e[Ss]harper 93 | *.DotSettings.user 94 | 95 | # JustCode is a .NET coding addin-in 96 | .JustCode 97 | 98 | # TeamCity is a build add-in 99 | _TeamCity* 100 | 101 | # DotCover is a Code Coverage Tool 102 | *.dotCover 103 | 104 | # NCrunch 105 | *.ncrunch* 106 | _NCrunch_* 107 | .*crunch*.local.xml 108 | 109 | # MightyMoose 110 | *.mm.* 111 | AutoTest.Net/ 112 | 113 | # Web workbench (sass) 114 | .sass-cache/ 115 | 116 | # Installshield output folder 117 | [Ee]xpress/ 118 | 119 | # DocProject is a documentation generator add-in 120 | DocProject/buildhelp/ 121 | DocProject/Help/*.HxT 122 | DocProject/Help/*.HxC 123 | DocProject/Help/*.hhc 124 | DocProject/Help/*.hhk 125 | DocProject/Help/*.hhp 126 | DocProject/Help/Html2 127 | DocProject/Help/html 128 | 129 | # Click-Once directory 130 | publish/ 131 | 132 | # Publish Web Output 133 | *.[Pp]ublish.xml 134 | *.azurePubxml 135 | 136 | # NuGet Packages Directory 137 | packages/ 138 | ## TODO: If the tool you use requires repositories.config uncomment the next line 139 | #!packages/repositories.config 140 | 141 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 142 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 143 | !packages/build/ 144 | 145 | # Windows Azure Build Output 146 | csx/ 147 | *.build.csdef 148 | 149 | # Windows Store app package directory 150 | AppPackages/ 151 | 152 | # Others 153 | sql/ 154 | *.Cache 155 | ClientBin/ 156 | [Ss]tyle[Cc]op.* 157 | ~$* 158 | *~ 159 | *.dbmdl 160 | *.dbproj.schemaview 161 | *.pfx 162 | *.publishsettings 163 | node_modules/ 164 | .DS_Store 165 | 166 | # RIA/Silverlight projects 167 | Generated_Code/ 168 | 169 | # Backup & report files from converting an old project file to a newer 170 | # Visual Studio version. Backup files are not needed, because we have git ;-) 171 | _UpgradeReport_Files/ 172 | Backup*/ 173 | UpgradeLog*.XML 174 | UpgradeLog*.htm 175 | 176 | # SQL Server files 177 | *.mdf 178 | *.ldf 179 | 180 | # Business Intelligence projects 181 | *.rdl.data 182 | *.bim.layout 183 | *.bim_*.settings 184 | 185 | # Microsoft Fakes 186 | FakesAssemblies/ 187 | project.lock.json 188 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 kamu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SvgImageSource for Xamarin.Forms 2 | 3 | This is a package to add SvgImageSource to Xamarin.Forms as new ImageSource. Thereby Xamarin.Forms.Image will become able to display a SVG image without particular modified. 4 | 5 | **Now version is pre release.** 6 | Using this library have to install more than or equal Xamarin.Forms 2.4.0.266 -pre1. 7 | 8 | ## Nuget Installation 9 | 10 | https://www.nuget.org/packages/Xamarin.Forms.Svg/ 11 | 12 | ```bash 13 | Install-Package Xamain.Forms.Svg -pre 14 | ``` 15 | 16 | You need to install this nuget package to PCL project and each platform project. 17 | 18 | ## Preparing to use 19 | 20 | ### iOS AppDelegate.cs. 21 | 22 | ```csharp 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.Init(); 26 | 27 | Xamarin.Forms.Svg.iOS.SvgImage.Init(); //need to write here 28 | 29 | LoadApplication(new App(new iOSInitializer())); 30 | 31 | return base.FinishedLaunching(app, options); 32 | } 33 | ``` 34 | 35 | ### Android MainActivity.cs 36 | 37 | ```csharp 38 | protected override void OnCreate(Bundle bundle) 39 | { 40 | ... 41 | global::Xamarin.Forms.Forms.Init(this, bundle); 42 | 43 | Xamarin.Forms.Svg.Droid.SvgImage.Init(); //need to write here 44 | 45 | LoadApplication(new App(new AndroidInitializer())); 46 | } 47 | ``` 48 | 49 | ### PCL 50 | 51 | In case specifying svg's resource with only Xaml, following code has to be written in App.xaml.cs. 52 | 53 | ```csharp 54 | public App() 55 | { 56 | InitializeComponent(); 57 | 58 | SvgImageSource.RegisterAssembly(); 59 | //SvgImageSource.RegisterAssembly(typeof(typehavingresource)); in case other assembly 60 | } 61 | ``` 62 | 63 | ## How to use 64 | 65 | ```csharp 66 | public ImageSource Image { get; set; } 67 | 68 | public SomeViewModel(){ 69 | //specify resource's path 70 | Image = SvgImageSource.FromSvg("Resource.some.svg"); 71 | //specify color 72 | Image = SvgImageSource.FromSvg("Resource.some.svg", Color.Red); 73 | //specify width height 74 | Image = SvgImageSource.FromSvg("Resourece.some.svg", 150, 50) 75 | } 76 | ``` 77 | 78 | ```xml 79 | 80 | ``` 81 | Resource path is found by backward match. 82 | 83 | 84 | ### only Xaml 85 | 86 | ```xml 87 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | ``` 100 | 101 | ## License 102 | 103 | MIT Licensed. 104 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with your package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Content.PM; 3 | using Android.OS; 4 | using Prism; 5 | using Prism.Ioc; 6 | 7 | namespace Sample.Droid 8 | { 9 | [Activity(Label = "Sample.Droid", Icon = "@drawable/icon",Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 10 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 11 | { 12 | protected override void OnCreate(Bundle bundle) 13 | { 14 | TabLayoutResource = Resource.Layout.Tabbar; 15 | ToolbarResource = Resource.Layout.Toolbar; 16 | 17 | base.OnCreate(bundle); 18 | 19 | global::Xamarin.Forms.Forms.Init(this, bundle); 20 | 21 | Xamarin.Forms.Svg.Droid.SvgImage.Init(); 22 | 23 | LoadApplication(new App(new AndroidInitializer())); 24 | } 25 | } 26 | 27 | public class AndroidInitializer : IPlatformInitializer 28 | { 29 | public void RegisterTypes(IContainerRegistry containerRegistry) 30 | { 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using Android.App; 4 | 5 | // Information about this assembly is defined by the following attributes. 6 | // Change them to the values specific to your project. 7 | 8 | [assembly: AssemblyTitle("Sample.Droid")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("")] 13 | [assembly: AssemblyCopyright("kamusoft")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 20 | 21 | [assembly: AssemblyVersion("1.0.0")] 22 | 23 | // The following attributes are used to specify the signing key for the assembly, 24 | // if desired. See the Mono documentation for more information about signing. 25 | 26 | //[assembly: AssemblyDelaySign(false)] 27 | //[assembly: AssemblyKeyFile("")] 28 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.axml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable/ 12 | icon.png 13 | 14 | layout/ 15 | main.axml 16 | 17 | values/ 18 | strings.xml 19 | 20 | In order to get the build system to recognize Android resources, set the build action to 21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 22 | instead operate on resource IDs. When you compile an Android application that uses resources, 23 | the build system will package the resources for distribution and generate a class called "R" 24 | (this is an Android convention) that contains the tokens for each one of the resources 25 | included. For example, for the above Resources layout, this is what the R class would expose: 26 | 27 | public class R { 28 | public class drawable { 29 | public const int icon = 0x123; 30 | } 31 | 32 | public class layout { 33 | public const int main = 0x456; 34 | } 35 | 36 | public class strings { 37 | public const int first_string = 0xabc; 38 | public const int second_string = 0xbcd; 39 | } 40 | } 41 | 42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main 43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first 44 | string in the dictionary file values/strings.xml. 45 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muak/SvgImageSource/922a0dbbbf0b175d6a5ee5766d2891ebb5b93fdf/Sample/Sample.Droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muak/SvgImageSource/922a0dbbbf0b175d6a5ee5766d2891ebb5b93fdf/Sample/Sample.Droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muak/SvgImageSource/922a0dbbbf0b175d6a5ee5766d2891ebb5b93fdf/Sample/Sample.Droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muak/SvgImageSource/922a0dbbbf0b175d6a5ee5766d2891ebb5b93fdf/Sample/Sample.Droid/Resources/drawable/icon.png -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 5 | 6 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/Sample.Droid.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {346B7F68-2775-472A-A693-EF333F750619} 8 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | Library 10 | Sample.Droid 11 | Sample.Droid 12 | v8.1 13 | True 14 | Resources\Resource.designer.cs 15 | Resource 16 | Properties\AndroidManifest.xml 17 | Resources 18 | Assets 19 | true 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug 26 | DEBUG; 27 | prompt 28 | 4 29 | None 30 | 31 | 32 | true 33 | pdbonly 34 | true 35 | bin\Release 36 | prompt 37 | 4 38 | true 39 | false 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 48 | 49 | 50 | 51 | 52 | 53 | 54 | ..\packages\System.Reactive.Interfaces.3.1.1\lib\netstandard1.0\System.Reactive.Interfaces.dll 55 | 56 | 57 | ..\packages\System.Reactive.Core.3.1.1\lib\netstandard1.3\System.Reactive.Core.dll 58 | 59 | 60 | ..\packages\System.Reactive.Linq.3.1.1\lib\netstandard1.3\System.Reactive.Linq.dll 61 | 62 | 63 | ..\packages\System.Reactive.PlatformServices.3.1.1\lib\netstandard1.3\System.Reactive.PlatformServices.dll 64 | 65 | 66 | ..\packages\Prism.Core.7.0.0.396\lib\netstandard2.0\Prism.dll 67 | 68 | 69 | ..\packages\Unity.5.5.5\lib\netstandard2.0\CommonServiceLocator.dll 70 | 71 | 72 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.Abstractions.dll 73 | 74 | 75 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.Container.dll 76 | 77 | 78 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.ServiceLocation.dll 79 | 80 | 81 | ..\packages\Prism.Forms.7.0.0.396\lib\netstandard2.0\Prism.Forms.dll 82 | 83 | 84 | ..\packages\Prism.Unity.Forms.7.0.0.396\lib\netstandard2.0\Prism.Unity.Forms.dll 85 | 86 | 87 | ..\packages\ReactiveProperty.4.2.2\lib\MonoAndroid\ReactiveProperty.Android.dll 88 | 89 | 90 | ..\packages\ReactiveProperty.4.2.2\lib\MonoAndroid\ReactiveProperty.dll 91 | 92 | 93 | ..\packages\Xamarin.Android.Support.Annotations.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Annotations.dll 94 | 95 | 96 | ..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Core.Common.dll 97 | 98 | 99 | ..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.3\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.dll 100 | 101 | 102 | ..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.3\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.dll 103 | 104 | 105 | ..\packages\Xamarin.Android.Support.Compat.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Compat.dll 106 | 107 | 108 | ..\packages\Xamarin.Android.Support.Core.UI.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Core.UI.dll 109 | 110 | 111 | ..\packages\Xamarin.Android.Support.Core.Utils.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Core.Utils.dll 112 | 113 | 114 | ..\packages\Xamarin.Android.Support.Fragment.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Fragment.dll 115 | 116 | 117 | ..\packages\Xamarin.Android.Support.Media.Compat.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Media.Compat.dll 118 | 119 | 120 | ..\packages\Xamarin.Android.Support.Transition.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Transition.dll 121 | 122 | 123 | ..\packages\Xamarin.Android.Support.v4.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.v4.dll 124 | 125 | 126 | ..\packages\Xamarin.Android.Support.v7.CardView.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.v7.CardView.dll 127 | 128 | 129 | ..\packages\Xamarin.Android.Support.v7.Palette.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.v7.Palette.dll 130 | 131 | 132 | ..\packages\Xamarin.Android.Support.v7.RecyclerView.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.v7.RecyclerView.dll 133 | 134 | 135 | ..\packages\Xamarin.Android.Support.Vector.Drawable.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Vector.Drawable.dll 136 | 137 | 138 | ..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Animated.Vector.Drawable.dll 139 | 140 | 141 | ..\packages\Xamarin.Android.Support.v7.AppCompat.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.v7.AppCompat.dll 142 | 143 | 144 | ..\packages\Xamarin.Android.Support.Design.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.Design.dll 145 | 146 | 147 | ..\packages\Xamarin.Android.Support.v7.MediaRouter.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.v7.MediaRouter.dll 148 | 149 | 150 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\MonoAndroid10\FormsViewGroup.dll 151 | 152 | 153 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\MonoAndroid10\Xamarin.Forms.Core.dll 154 | 155 | 156 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 157 | 158 | 159 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 160 | 161 | 162 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 163 | 164 | 165 | ..\packages\SkiaSharp.1.60.0\lib\MonoAndroid\SkiaSharp.dll 166 | 167 | 168 | ..\packages\SkiaSharp.Svg.1.60.0\lib\netstandard2.0\SkiaSharp.Extended.Svg.dll 169 | 170 | 171 | ..\packages\NGraphics.0.4.0\lib\MonoAndroid10\NGraphics.Android.dll 172 | 173 | 174 | ..\packages\NGraphics.0.4.0\lib\MonoAndroid10\NGraphics.dll 175 | 176 | 177 | 178 | 179 | {2DB58246-77D5-4190-B0A0-F125B538309B} 180 | Sample 181 | 182 | 183 | {52EEAF44-C994-4359-B6C9-C20250ACB298} 184 | SvgImageSource 185 | 186 | 187 | {D594E0E9-0616-4537-86D7-4A70E59C03F1} 188 | SvgImageSource.Droid 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | -------------------------------------------------------------------------------- /Sample/Sample.Droid/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | using Prism; 3 | using Prism.Ioc; 4 | using UIKit; 5 | 6 | namespace Sample.iOS 7 | { 8 | // The UIApplicationDelegate for the application. This class is responsible for launching the 9 | // User Interface of the application, as well as listening (and optionally responding) to 10 | // application events from iOS. 11 | [Register("AppDelegate")] 12 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 13 | { 14 | // 15 | // This method is invoked when the application has loaded and is ready to run. In this 16 | // method you should instantiate the window, load the UI into it and then make the window 17 | // visible. 18 | // 19 | // You have 17 seconds to return from this method, or iOS will terminate your application. 20 | // 21 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 22 | { 23 | global::Xamarin.Forms.Forms.Init(); 24 | Xamarin.Forms.Svg.iOS.SvgImage.Init(); 25 | 26 | LoadApplication(new App(new iOSInitializer())); 27 | 28 | return base.FinishedLaunching(app, options); 29 | } 30 | } 31 | 32 | public class iOSInitializer : IPlatformInitializer 33 | { 34 | public void RegisterTypes(IContainerRegistry containerRegistry) 35 | { 36 | 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDisplayName 6 | Sample 7 | CFBundleIdentifier 8 | kamusoft.sample 9 | CFBundleShortVersionString 10 | 1.0 11 | CFBundleVersion 12 | 1.0 13 | LSRequiresIPhoneOS 14 | 15 | MinimumOSVersion 16 | 9.3 17 | UIDeviceFamily 18 | 19 | 1 20 | 2 21 | 22 | UILaunchStoryboardName 23 | LaunchScreen 24 | UIRequiredDeviceCapabilities 25 | 26 | armv7 27 | 28 | UISupportedInterfaceOrientations 29 | 30 | UIInterfaceOrientationPortrait 31 | UIInterfaceOrientationLandscapeLeft 32 | UIInterfaceOrientationLandscapeRight 33 | 34 | UISupportedInterfaceOrientations~ipad 35 | 36 | UIInterfaceOrientationPortrait 37 | UIInterfaceOrientationPortraitUpsideDown 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | XSAppIconAssets 42 | Resources/Images.xcassets/AppIcons.appiconset 43 | CFBundleName 44 | Sample 45 | 46 | 47 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace Sample.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/Images.xcassets/AppIcons.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "size": "29x29", 5 | "scale": "1x", 6 | "idiom": "iphone" 7 | }, 8 | { 9 | "size": "29x29", 10 | "scale": "2x", 11 | "idiom": "iphone" 12 | }, 13 | { 14 | "size": "29x29", 15 | "scale": "3x", 16 | "idiom": "iphone" 17 | }, 18 | { 19 | "size": "40x40", 20 | "scale": "2x", 21 | "idiom": "iphone" 22 | }, 23 | { 24 | "size": "40x40", 25 | "scale": "3x", 26 | "idiom": "iphone" 27 | }, 28 | { 29 | "size": "57x57", 30 | "scale": "1x", 31 | "idiom": "iphone" 32 | }, 33 | { 34 | "size": "57x57", 35 | "scale": "2x", 36 | "idiom": "iphone" 37 | }, 38 | { 39 | "size": "60x60", 40 | "scale": "2x", 41 | "idiom": "iphone" 42 | }, 43 | { 44 | "size": "60x60", 45 | "scale": "3x", 46 | "idiom": "iphone" 47 | }, 48 | { 49 | "size": "29x29", 50 | "scale": "1x", 51 | "idiom": "ipad" 52 | }, 53 | { 54 | "size": "29x29", 55 | "scale": "2x", 56 | "idiom": "ipad" 57 | }, 58 | { 59 | "size": "40x40", 60 | "scale": "1x", 61 | "idiom": "ipad" 62 | }, 63 | { 64 | "size": "40x40", 65 | "scale": "2x", 66 | "idiom": "ipad" 67 | }, 68 | { 69 | "size": "50x50", 70 | "scale": "1x", 71 | "idiom": "ipad" 72 | }, 73 | { 74 | "size": "50x50", 75 | "scale": "2x", 76 | "idiom": "ipad" 77 | }, 78 | { 79 | "size": "72x72", 80 | "scale": "1x", 81 | "idiom": "ipad" 82 | }, 83 | { 84 | "size": "72x72", 85 | "scale": "2x", 86 | "idiom": "ipad" 87 | }, 88 | { 89 | "size": "76x76", 90 | "scale": "1x", 91 | "idiom": "ipad" 92 | }, 93 | { 94 | "size": "76x76", 95 | "scale": "2x", 96 | "idiom": "ipad" 97 | }, 98 | { 99 | "size": "120x120", 100 | "scale": "1x", 101 | "idiom": "car" 102 | } 103 | ], 104 | "info": { 105 | "version": 1, 106 | "author": "xcode" 107 | } 108 | } -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muak/SvgImageSource/922a0dbbbf0b175d6a5ee5766d2891ebb5b93fdf/Sample/Sample.iOS/Resources/icon.png -------------------------------------------------------------------------------- /Sample/Sample.iOS/Sample.iOS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | iPhoneSimulator 7 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A} 8 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9 | Exe 10 | Sample.iOS 11 | Sample.iOS 12 | Resources 13 | 14 | 15 | true 16 | full 17 | false 18 | bin\iPhoneSimulator\Debug 19 | DEBUG;ENABLE_TEST_CLOUD; 20 | prompt 21 | 4 22 | iPhone Developer 23 | true 24 | true 25 | true 26 | true 27 | 13206 28 | None 29 | i386, x86_64 30 | HttpClientHandler 31 | x86 32 | 33 | 34 | pdbonly 35 | true 36 | bin\iPhone\Release 37 | prompt 38 | 4 39 | iPhone Developer 40 | true 41 | Entitlements.plist 42 | SdkOnly 43 | ARMv7, ARM64 44 | HttpClientHandler 45 | x86 46 | 47 | 48 | pdbonly 49 | true 50 | bin\iPhoneSimulator\Release 51 | prompt 52 | 4 53 | iPhone Developer 54 | true 55 | true 56 | None 57 | i386, x86_64 58 | HttpClientHandler 59 | x86 60 | 61 | 62 | true 63 | full 64 | false 65 | bin\iPhone\Debug 66 | DEBUG;ENABLE_TEST_CLOUD; 67 | prompt 68 | 4 69 | iPhone Developer 70 | true 71 | true 72 | true 73 | true 74 | true 75 | Entitlements.plist 76 | SdkOnly 77 | ARMv7, ARM64 78 | HttpClientHandler 79 | x86 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll 88 | 89 | 90 | 91 | 92 | ..\packages\System.Reactive.Core.3.1.1\lib\netstandard1.3\System.Reactive.Core.dll 93 | 94 | 95 | ..\packages\System.Reactive.Linq.3.1.1\lib\netstandard1.3\System.Reactive.Linq.dll 96 | 97 | 98 | ..\packages\System.Reactive.PlatformServices.3.1.1\lib\netstandard1.3\System.Reactive.PlatformServices.dll 99 | 100 | 101 | ..\packages\Prism.Core.7.0.0.396\lib\netstandard2.0\Prism.dll 102 | 103 | 104 | ..\packages\Unity.5.5.5\lib\netstandard2.0\CommonServiceLocator.dll 105 | 106 | 107 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.Abstractions.dll 108 | 109 | 110 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.Container.dll 111 | 112 | 113 | ..\packages\Unity.5.5.5\lib\netstandard2.0\Unity.ServiceLocation.dll 114 | 115 | 116 | ..\packages\Prism.Forms.7.0.0.396\lib\netstandard2.0\Prism.Forms.dll 117 | 118 | 119 | ..\packages\Prism.Unity.Forms.7.0.0.396\lib\netstandard2.0\Prism.Unity.Forms.dll 120 | 121 | 122 | ..\packages\ReactiveProperty.4.2.2\lib\Xamarin.iOS10\ReactiveProperty.dll 123 | 124 | 125 | ..\packages\ReactiveProperty.4.2.2\lib\Xamarin.iOS10\ReactiveProperty.iOS.dll 126 | 127 | 128 | ..\packages\System.Reactive.Interfaces.3.1.1\lib\netstandard1.0\System.Reactive.Interfaces.dll 129 | 130 | 131 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll 132 | 133 | 134 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll 135 | 136 | 137 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll 138 | 139 | 140 | ..\packages\Xamarin.Forms.3.0.0.482510\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll 141 | 142 | 143 | ..\packages\SkiaSharp.1.60.0\lib\XamariniOS\SkiaSharp.dll 144 | 145 | 146 | ..\packages\SkiaSharp.Svg.1.60.0\lib\netstandard2.0\SkiaSharp.Extended.Svg.dll 147 | 148 | 149 | 150 | 151 | {2DB58246-77D5-4190-B0A0-F125B538309B} 152 | Sample 153 | 154 | 155 | {52EEAF44-C994-4359-B6C9-C20250ACB298} 156 | SvgImageSource 157 | 158 | 159 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E} 160 | SvgImageSource.iOS 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /Sample/Sample.iOS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Sample/Sample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Sample\Sample.csproj", "{2DB58246-77D5-4190-B0A0-F125B538309B}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.iOS", "Sample.iOS\Sample.iOS.csproj", "{4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Droid", "Sample.Droid\Sample.Droid.csproj", "{346B7F68-2775-472A-A693-EF333F750619}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvgImageSource", "..\SvgImageSource\SvgImageSource.csproj", "{52EEAF44-C994-4359-B6C9-C20250ACB298}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvgImageSource.Droid", "..\SvgImageSource.Droid\SvgImageSource.Droid.csproj", "{D594E0E9-0616-4537-86D7-4A70E59C03F1}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SvgImageSource.iOS", "..\SvgImageSource.iOS\SvgImageSource.iOS.csproj", "{9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 21 | Release|iPhone = Release|iPhone 22 | Release|iPhoneSimulator = Release|iPhoneSimulator 23 | Debug|iPhone = Debug|iPhone 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 31 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 32 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Release|iPhone.ActiveCfg = Release|Any CPU 33 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Release|iPhone.Build.0 = Release|Any CPU 34 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 35 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 36 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Debug|iPhone.ActiveCfg = Debug|Any CPU 37 | {2DB58246-77D5-4190-B0A0-F125B538309B}.Debug|iPhone.Build.0 = Debug|Any CPU 38 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator 39 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator 40 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Release|Any CPU.ActiveCfg = Release|iPhone 41 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Release|Any CPU.Build.0 = Release|iPhone 42 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 43 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 44 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Release|iPhone.ActiveCfg = Release|iPhone 45 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Release|iPhone.Build.0 = Release|iPhone 46 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 47 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 48 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Debug|iPhone.ActiveCfg = Debug|iPhone 49 | {4F72DBDE-0259-4476-AC2D-DA4D167E2A7A}.Debug|iPhone.Build.0 = Debug|iPhone 50 | {346B7F68-2775-472A-A693-EF333F750619}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {346B7F68-2775-472A-A693-EF333F750619}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {346B7F68-2775-472A-A693-EF333F750619}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {346B7F68-2775-472A-A693-EF333F750619}.Release|Any CPU.Build.0 = Release|Any CPU 54 | {346B7F68-2775-472A-A693-EF333F750619}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 55 | {346B7F68-2775-472A-A693-EF333F750619}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 56 | {346B7F68-2775-472A-A693-EF333F750619}.Release|iPhone.ActiveCfg = Release|Any CPU 57 | {346B7F68-2775-472A-A693-EF333F750619}.Release|iPhone.Build.0 = Release|Any CPU 58 | {346B7F68-2775-472A-A693-EF333F750619}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 59 | {346B7F68-2775-472A-A693-EF333F750619}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 60 | {346B7F68-2775-472A-A693-EF333F750619}.Debug|iPhone.ActiveCfg = Debug|Any CPU 61 | {346B7F68-2775-472A-A693-EF333F750619}.Debug|iPhone.Build.0 = Debug|Any CPU 62 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 63 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Debug|Any CPU.Build.0 = Debug|Any CPU 64 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Release|Any CPU.ActiveCfg = Release|Any CPU 65 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Release|Any CPU.Build.0 = Release|Any CPU 66 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 67 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 68 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Release|iPhone.ActiveCfg = Release|Any CPU 69 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Release|iPhone.Build.0 = Release|Any CPU 70 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 71 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 72 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Debug|iPhone.ActiveCfg = Debug|Any CPU 73 | {52EEAF44-C994-4359-B6C9-C20250ACB298}.Debug|iPhone.Build.0 = Debug|Any CPU 74 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 75 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Debug|Any CPU.Build.0 = Debug|Any CPU 76 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Release|Any CPU.ActiveCfg = Release|Any CPU 77 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Release|Any CPU.Build.0 = Release|Any CPU 78 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 79 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 80 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Release|iPhone.ActiveCfg = Release|Any CPU 81 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Release|iPhone.Build.0 = Release|Any CPU 82 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 83 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 84 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Debug|iPhone.ActiveCfg = Debug|Any CPU 85 | {D594E0E9-0616-4537-86D7-4A70E59C03F1}.Debug|iPhone.Build.0 = Debug|Any CPU 86 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 87 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Debug|Any CPU.Build.0 = Debug|Any CPU 88 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Release|Any CPU.ActiveCfg = Release|Any CPU 89 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Release|Any CPU.Build.0 = Release|Any CPU 90 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 91 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 92 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Release|iPhone.ActiveCfg = Release|Any CPU 93 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Release|iPhone.Build.0 = Release|Any CPU 94 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 95 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 96 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Debug|iPhone.ActiveCfg = Debug|Any CPU 97 | {9E5E35F4-F9AE-4E17-B2AE-6A068AF80B6E}.Debug|iPhone.Build.0 = Debug|Any CPU 98 | EndGlobalSection 99 | EndGlobal 100 | -------------------------------------------------------------------------------- /Sample/Sample/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Sample/Sample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Prism; 2 | using Prism.Ioc; 3 | using Prism.Unity; 4 | using Sample.Views; 5 | using Xamarin.Forms.Svg; 6 | using Xamarin.Forms; 7 | 8 | namespace Sample 9 | { 10 | public partial class App : PrismApplication 11 | { 12 | public App(IPlatformInitializer initializer = null) : base(initializer) { } 13 | 14 | 15 | protected override void OnInitialized() 16 | { 17 | InitializeComponent(); 18 | 19 | SvgImageSource.RegisterAssembly(); 20 | 21 | NavigationService.NavigateAsync("/NavigationPage/MainPage"); 22 | } 23 | 24 | protected override void RegisterTypes(IContainerRegistry containerRegistry) 25 | { 26 | containerRegistry.RegisterForNavigation(); 27 | containerRegistry.RegisterForNavigation(); 28 | } 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /Sample/Sample/Resources/colours.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 14 | 15 | -------------------------------------------------------------------------------- /Sample/Sample/Resources/flower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muak/SvgImageSource/922a0dbbbf0b175d6a5ee5766d2891ebb5b93fdf/Sample/Sample/Resources/flower.jpg -------------------------------------------------------------------------------- /Sample/Sample/Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muak/SvgImageSource/922a0dbbbf0b175d6a5ee5766d2891ebb5b93fdf/Sample/Sample/Resources/icon.png -------------------------------------------------------------------------------- /Sample/Sample/Resources/ios-star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sample/Sample/Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Sample/Sample/ViewModels/MainPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using Prism.Mvvm; 5 | using Reactive.Bindings; 6 | using Xamarin.Forms; 7 | using Xamarin.Forms.Svg; 8 | 9 | namespace Sample.ViewModels 10 | { 11 | public class MainPageViewModel : BindableBase 12 | { 13 | public ReactiveProperty Image { get; } = new ReactiveProperty(); 14 | public ReactiveProperty Image2 { get; } = new ReactiveProperty(); 15 | public ReactiveProperty Image3 { get; } = new ReactiveProperty(); 16 | public ReactiveProperty Image4 { get; } = new ReactiveProperty(); 17 | public ReactiveProperty Image5 { get; } = new ReactiveProperty(); 18 | public ReactiveProperty Image6 { get; } = new ReactiveProperty(); 19 | public ReactiveProperty Image7 { get; } = new ReactiveProperty(); 20 | public ReactiveProperty Image8 { get; } = new ReactiveProperty(); 21 | public ReactiveProperty Image9 { get; } = new ReactiveProperty(); 22 | public ReactiveProperty Image10 { get; } = new ReactiveProperty(); 23 | public ReactiveCommand ChangeCommand { get; } = new ReactiveCommand(); 24 | public ReactiveProperty ImagePath { get; } = new ReactiveProperty(); 25 | 26 | int toggle = 0; 27 | 28 | public MainPageViewModel() 29 | { 30 | ImagePath.Value = "ios-star.svg"; 31 | //var asm = this.GetType().Assembly; 32 | //var path = asm.GetManifestResourceNames() 33 | // .FirstOrDefault(x => x.EndsWith("flower.jpg", StringComparison.CurrentCultureIgnoreCase)); 34 | //Func stream = () => asm.GetManifestResourceStream(path); 35 | 36 | //var svgPath = asm.GetManifestResourceNames() 37 | // .FirstOrDefault(x => x.EndsWith("tiger.svg", StringComparison.CurrentCultureIgnoreCase)); 38 | //Func svgStream = () => asm.GetManifestResourceStream(svgPath); 39 | 40 | //Image = SvgImageSource.FromSvg("Resource.tiger.svg",50,50); 41 | //Image.Value = SvgImageSource.FromSvg("ios-star.svg",50,50); 42 | 43 | ChangeCommand.Subscribe(_ => 44 | { 45 | if (toggle == 0) 46 | { 47 | ImagePath.Value = "colours.svg"; 48 | toggle++; 49 | } 50 | else{ 51 | ImagePath.Value = "ios-star.svg"; 52 | toggle--; 53 | } 54 | 55 | //switch(toggle){ 56 | // case 0: 57 | // Image.Value = SvgImageSource.FromSvg("ios-star.svg"); 58 | // Image2.Value = SvgImageSource.FromSvg("tiger.svg"); 59 | // Image3.Value = SvgImageSource.FromSvg("colours.svg"); 60 | // Image4.Value = SvgImageSource.FromSvg("colours.svg",120,120,Color.Green); 61 | // Image5.Value = SvgImageSource.FromSvg("tiger.svg",50,50); 62 | // Image6.Value = SvgImageSource.FromSvg("ios-star.svg"); 63 | // Image7.Value = SvgImageSource.FromSvg("ios-star.svg"); 64 | // Image8.Value = SvgImageSource.FromSvg("ios-star.svg"); 65 | // Image9.Value = SvgImageSource.FromSvg("ios-star.svg"); 66 | // Image10.Value = SvgImageSource.FromSvg("ios-star.svg"); 67 | 68 | // //Image.Value = SvgImageSource.FromResource("ios-star.svg"); 69 | // //Image2.Value = SvgImageSource.FromResource("ios-star.svg",50,50,Color.Red); 70 | // //Image3.Value = SvgImageSource.FromStream(svgStream,100,100,Color.Blue); 71 | // //Image4.Value = SvgImageSource.FromUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg",120,120,Color.Green); 72 | // //Image5.Value = SvgImageSource.FromResource("tiger.svg",50,50); 73 | // //Image6.Value = SvgImageSource.FromResource("ios-star.svg"); 74 | // //Image7.Value = SvgImageSource.FromResource("ios-star.svg"); 75 | // //Image8.Value = SvgImageSource.FromResource("ios-star.svg"); 76 | // //Image9.Value = SvgImageSource.FromResource("ios-star.svg"); 77 | // //Image10.Value = SvgImageSource.FromResource("ios-star.svg"); 78 | // //Image.Value = CachedImageSource.FromSvg("colours.svg",100,100,Color.Blue); 79 | // //Image2.Value = CachedImageSource.FromSvg("colours.svg", 50, 50, Color.Red); 80 | // break; 81 | // case 1: 82 | // Image.Value = SvgImageSource.FromSvg("ios-star.svg"); 83 | // Image2.Value = SvgImageSource.FromSvg("tiger.svg"); 84 | // Image3.Value = SvgImageSource.FromSvg("colours.svg"); 85 | // Image4.Value = SvgImageSource.FromSvg("colours.svg", 120, 120, Color.Green); 86 | // Image5.Value = SvgImageSource.FromSvg("tiger.svg", 50, 50); 87 | // Image6.Value = SvgImageSource.FromSvg("ios-star.svg"); 88 | // Image7.Value = SvgImageSource.FromSvg("ios-star.svg"); 89 | // Image8.Value = SvgImageSource.FromSvg("ios-star.svg"); 90 | // Image9.Value = SvgImageSource.FromSvg("ios-star.svg"); 91 | // Image10.Value = SvgImageSource.FromSvg("ios-star.svg"); 92 | // toggle = -1; 93 | // break; 94 | // case 2: 95 | 96 | // break; 97 | // case 3: 98 | // //https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg 99 | // //Image.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg",50,50, Color.FromHex("#80FFFF00")); 100 | // //Image2.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg", 100, 100, Color.DarkOrange); 101 | // //Image3.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg",50,50, Color.FromHex("#80FFFF00")); 102 | // //Image4.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg", 100, 100, Color.DarkOrange); 103 | // //Image5.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg",50,50, Color.FromHex("#80FFFF00")); 104 | // //Image6.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg", 100, 100, Color.DarkOrange); 105 | // //Image7.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg",50,50, Color.FromHex("#80FFFF00")); 106 | // //Image8.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg", 100, 100, Color.DarkOrange); 107 | // //Image9.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg", 50,50,Color.FromHex("#80FFFF00")); 108 | // //Image10.Value = SvgImageSource.FromSvgUri("https://dl.dropbox.com/s/d2ijcomn07tfy56/adjust.svg", 100, 100, Color.DarkOrange); 109 | // break; 110 | // case 4: 111 | // //Image.Value = SvgImageSource.FromStream(stream); 112 | // //Image2.Value = SvgImageSource.FromStream(stream); 113 | // //Image3.Value = SvgImageSource.FromStream(stream); 114 | // //Image4.Value = SvgImageSource.FromStream(stream); 115 | // //Image5.Value = SvgImageSource.FromStream(stream); 116 | // //Image6.Value = SvgImageSource.FromStream(stream); 117 | // //Image7.Value = SvgImageSource.FromStream(stream); 118 | // //Image8.Value = SvgImageSource.FromStream(stream); 119 | // //Image9.Value = SvgImageSource.FromStream(stream); 120 | // //Image10.Value = SvgImageSource.FromStream(stream); 121 | // break; 122 | // case 5: 123 | // //https://dl.dropbox.com/s/khdn0tpgjngdw4r/tiger.svg 124 | // //Image.Value = SvgImageSource.FromSvgStream(svgStream,200,200,Color.Default); 125 | // //Image2.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Green); 126 | // //Image3.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Green); 127 | // //Image4.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Green); 128 | // //Image5.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Green); 129 | // //Image6.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Default); 130 | // //Image7.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Green); 131 | // //Image8.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Green); 132 | // //Image9.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Green); 133 | // //Image10.Value = SvgImageSource.FromSvgStream(svgStream,50,50,Color.Red); 134 | // break; 135 | // case 6: 136 | // //Image.Value = SvgImageSource.FromNativeFile("icon.png"); 137 | // //Image2.Value = SvgImageSource.FromNativeFile("icon.png"); 138 | // //Image3.Value = SvgImageSource.FromNativeFile("icon.png"); 139 | // //Image4.Value = SvgImageSource.FromNativeFile("icon.png"); 140 | // //Image5.Value = SvgImageSource.FromNativeFile("icon.png"); 141 | // //Image6.Value = SvgImageSource.FromNativeFile("icon.png"); 142 | // //Image7.Value = SvgImageSource.FromNativeFile("icon.png"); 143 | // //Image8.Value = SvgImageSource.FromNativeFile("icon.png"); 144 | // //Image9.Value = SvgImageSource.FromNativeFile("icon.png"); 145 | // //Image10.Value = SvgImageSource.FromNativeFile("icon.png"); 146 | // toggle = -1; 147 | // break; 148 | //} 149 | 150 | //toggle++; 151 | 152 | }); 153 | 154 | //ChangeCommand.Execute(); 155 | } 156 | 157 | } 158 | } -------------------------------------------------------------------------------- /Sample/Sample/Views/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 |