├── .github └── workflows │ └── publish.yml ├── .gitignore ├── LICENSE ├── Material.Icons.Avalonia.Demo ├── .gitignore ├── App.xaml ├── App.xaml.cs ├── Assets │ └── avalonia-logo.ico ├── Controls │ └── SelectionWrapper.cs ├── Material.Icons.Avalonia.Demo.csproj ├── Models │ ├── PackIconKindGroup.cs │ └── StringJoinConverter.cs ├── Program.cs ├── ViewLocator.cs ├── ViewModels │ ├── MainWindowViewModel.cs │ └── ViewModelBase.cs ├── Views │ ├── MainWindow.xaml │ └── MainWindow.xaml.cs └── nuget.config ├── Material.Icons.Avalonia.sln ├── Material.Icons.Avalonia ├── .gitignore ├── App.xaml ├── App.xaml.cs ├── GeometryConverter.cs ├── Material.Icons.Avalonia.csproj ├── MaterialIcon.xaml ├── MaterialIcon.xaml.cs └── MaterialIconExt.cs └── README.md /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: .NET Publish 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Setup .NET 14 | uses: actions/setup-dotnet@v1 15 | with: 16 | dotnet-version: 3.1.x 17 | - name: Build and Pack 18 | run: | 19 | dotnet build Material.Icons.Avalonia 20 | dotnet pack Material.Icons.Avalonia 21 | - name: Publish to Nuget 22 | run: dotnet nuget push "Material.Icons.Avalonia/bin/Debug/*.nupkg" --api-key ${{secrets.NUGET_KEY}} --source https://api.nuget.org/v3/index.json --skip-duplicate 23 | - name: Publish to GitHub Packages 24 | run: dotnet nuget push "Material.Icons.Avalonia/bin/Debug/*.nupkg" --api-key ${{secrets.GITHUB_TOKEN}} --source https://nuget.pkg.github.com/AvaloniaUtils/index.json --skip-duplicate 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | /packages/ 4 | riderModule.iml 5 | /_ReSharper.Caches/ 6 | 7 | # Created by https://www.toptal.com/developers/gitignore/api/csharp 8 | # Edit at https://www.toptal.com/developers/gitignore?templates=csharp 9 | 10 | ### Csharp ### 11 | ## Ignore Visual Studio temporary files, build results, and 12 | ## files generated by popular Visual Studio add-ons. 13 | ## 14 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 15 | 16 | # User-specific files 17 | *.rsuser 18 | *.suo 19 | *.user 20 | *.userosscache 21 | *.sln.docstates 22 | 23 | # User-specific files (MonoDevelop/Xamarin Studio) 24 | *.userprefs 25 | 26 | # Mono auto generated files 27 | mono_crash.* 28 | 29 | # Build results 30 | [Dd]ebug/ 31 | [Dd]ebugPublic/ 32 | [Rr]elease/ 33 | [Rr]eleases/ 34 | x64/ 35 | x86/ 36 | [Aa][Rr][Mm]/ 37 | [Aa][Rr][Mm]64/ 38 | bld/ 39 | [Bb]in/ 40 | [Oo]bj/ 41 | [Ll]og/ 42 | [Ll]ogs/ 43 | 44 | # Visual Studio 2015/2017 cache/options directory 45 | .vs/ 46 | # Uncomment if you have tasks that create the project's static files in wwwroot 47 | #wwwroot/ 48 | 49 | # Visual Studio 2017 auto generated files 50 | Generated\ Files/ 51 | 52 | # MSTest test Results 53 | [Tt]est[Rr]esult*/ 54 | [Bb]uild[Ll]og.* 55 | 56 | # NUnit 57 | *.VisualState.xml 58 | TestResult.xml 59 | nunit-*.xml 60 | 61 | # Build Results of an ATL Project 62 | [Dd]ebugPS/ 63 | [Rr]eleasePS/ 64 | dlldata.c 65 | 66 | # Benchmark Results 67 | BenchmarkDotNet.Artifacts/ 68 | 69 | # .NET Core 70 | project.lock.json 71 | project.fragment.lock.json 72 | artifacts/ 73 | 74 | # StyleCop 75 | StyleCopReport.xml 76 | 77 | # Files built by Visual Studio 78 | *_i.c 79 | *_p.c 80 | *_h.h 81 | *.ilk 82 | *.meta 83 | !*.Meta/ 84 | *.obj 85 | *.iobj 86 | *.pch 87 | *.pdb 88 | *.ipdb 89 | *.pgc 90 | *.pgd 91 | *.rsp 92 | *.sbr 93 | *.tlb 94 | *.tli 95 | *.tlh 96 | *.tmp 97 | *.tmp_proj 98 | *_wpftmp.csproj 99 | *.log 100 | *.vspscc 101 | *.vssscc 102 | .builds 103 | *.pidb 104 | *.svclog 105 | *.scc 106 | 107 | # Chutzpah Test files 108 | _Chutzpah* 109 | 110 | # Visual C++ cache files 111 | ipch/ 112 | *.aps 113 | *.ncb 114 | *.opendb 115 | *.opensdf 116 | *.sdf 117 | *.cachefile 118 | *.VC.db 119 | *.VC.VC.opendb 120 | 121 | # Visual Studio profiler 122 | *.psess 123 | *.vsp 124 | *.vspx 125 | *.sap 126 | 127 | # Visual Studio Trace Files 128 | *.e2e 129 | 130 | # TFS 2012 Local Workspace 131 | $tf/ 132 | 133 | # Guidance Automation Toolkit 134 | *.gpState 135 | 136 | # ReSharper is a .NET coding add-in 137 | _ReSharper*/ 138 | *.[Rr]e[Ss]harper 139 | *.DotSettings.user 140 | 141 | # TeamCity is a build add-in 142 | _TeamCity* 143 | 144 | # DotCover is a Code Coverage Tool 145 | *.dotCover 146 | 147 | # AxoCover is a Code Coverage Tool 148 | .axoCover/* 149 | !.axoCover/settings.json 150 | 151 | # Coverlet is a free, cross platform Code Coverage Tool 152 | coverage*[.json, .xml, .info] 153 | 154 | # Visual Studio code coverage results 155 | *.coverage 156 | *.coveragexml 157 | 158 | # NCrunch 159 | _NCrunch_* 160 | .*crunch*.local.xml 161 | nCrunchTemp_* 162 | 163 | # MightyMoose 164 | *.mm.* 165 | AutoTest.Net/ 166 | 167 | # Web workbench (sass) 168 | .sass-cache/ 169 | 170 | # Installshield output folder 171 | [Ee]xpress/ 172 | 173 | # DocProject is a documentation generator add-in 174 | DocProject/buildhelp/ 175 | DocProject/Help/*.HxT 176 | DocProject/Help/*.HxC 177 | DocProject/Help/*.hhc 178 | DocProject/Help/*.hhk 179 | DocProject/Help/*.hhp 180 | DocProject/Help/Html2 181 | DocProject/Help/html 182 | 183 | # Click-Once directory 184 | publish/ 185 | 186 | # Publish Web Output 187 | *.[Pp]ublish.xml 188 | *.azurePubxml 189 | # Note: Comment the next line if you want to checkin your web deploy settings, 190 | # but database connection strings (with potential passwords) will be unencrypted 191 | *.pubxml 192 | *.publishproj 193 | 194 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 195 | # checkin your Azure Web App publish settings, but sensitive information contained 196 | # in these scripts will be unencrypted 197 | PublishScripts/ 198 | 199 | # NuGet Packages 200 | *.nupkg 201 | # NuGet Symbol Packages 202 | *.snupkg 203 | # The packages folder can be ignored because of Package Restore 204 | **/[Pp]ackages/* 205 | # except build/, which is used as an MSBuild target. 206 | !**/[Pp]ackages/build/ 207 | # Uncomment if necessary however generally it will be regenerated when needed 208 | #!**/[Pp]ackages/repositories.config 209 | # NuGet v3's project.json files produces more ignorable files 210 | *.nuget.props 211 | *.nuget.targets 212 | 213 | # Microsoft Azure Build Output 214 | csx/ 215 | *.build.csdef 216 | 217 | # Microsoft Azure Emulator 218 | ecf/ 219 | rcf/ 220 | 221 | # Windows Store app package directories and files 222 | AppPackages/ 223 | BundleArtifacts/ 224 | Package.StoreAssociation.xml 225 | _pkginfo.txt 226 | *.appx 227 | *.appxbundle 228 | *.appxupload 229 | 230 | # Visual Studio cache files 231 | # files ending in .cache can be ignored 232 | *.[Cc]ache 233 | # but keep track of directories ending in .cache 234 | !?*.[Cc]ache/ 235 | 236 | # Others 237 | ClientBin/ 238 | ~$* 239 | *~ 240 | *.dbmdl 241 | *.dbproj.schemaview 242 | *.jfm 243 | *.pfx 244 | *.publishsettings 245 | orleans.codegen.cs 246 | 247 | # Including strong name files can present a security risk 248 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 249 | #*.snk 250 | 251 | # Since there are multiple workflows, uncomment next line to ignore bower_components 252 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 253 | #bower_components/ 254 | 255 | # RIA/Silverlight projects 256 | Generated_Code/ 257 | 258 | # Backup & report files from converting an old project file 259 | # to a newer Visual Studio version. Backup files are not needed, 260 | # because we have git ;-) 261 | _UpgradeReport_Files/ 262 | Backup*/ 263 | UpgradeLog*.XML 264 | UpgradeLog*.htm 265 | ServiceFabricBackup/ 266 | *.rptproj.bak 267 | 268 | # SQL Server files 269 | *.mdf 270 | *.ldf 271 | *.ndf 272 | 273 | # Business Intelligence projects 274 | *.rdl.data 275 | *.bim.layout 276 | *.bim_*.settings 277 | *.rptproj.rsuser 278 | *- [Bb]ackup.rdl 279 | *- [Bb]ackup ([0-9]).rdl 280 | *- [Bb]ackup ([0-9][0-9]).rdl 281 | 282 | # Microsoft Fakes 283 | FakesAssemblies/ 284 | 285 | # GhostDoc plugin setting file 286 | *.GhostDoc.xml 287 | 288 | # Node.js Tools for Visual Studio 289 | .ntvs_analysis.dat 290 | node_modules/ 291 | 292 | # Visual Studio 6 build log 293 | *.plg 294 | 295 | # Visual Studio 6 workspace options file 296 | *.opt 297 | 298 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 299 | *.vbw 300 | 301 | # Visual Studio LightSwitch build output 302 | **/*.HTMLClient/GeneratedArtifacts 303 | **/*.DesktopClient/GeneratedArtifacts 304 | **/*.DesktopClient/ModelManifest.xml 305 | **/*.Server/GeneratedArtifacts 306 | **/*.Server/ModelManifest.xml 307 | _Pvt_Extensions 308 | 309 | # Paket dependency manager 310 | .paket/paket.exe 311 | paket-files/ 312 | 313 | # FAKE - F# Make 314 | .fake/ 315 | 316 | # CodeRush personal settings 317 | .cr/personal 318 | 319 | # Python Tools for Visual Studio (PTVS) 320 | __pycache__/ 321 | *.pyc 322 | 323 | # Cake - Uncomment if you are using it 324 | # tools/** 325 | # !tools/packages.config 326 | 327 | # Tabs Studio 328 | *.tss 329 | 330 | # Telerik's JustMock configuration file 331 | *.jmconfig 332 | 333 | # BizTalk build output 334 | *.btp.cs 335 | *.btm.cs 336 | *.odx.cs 337 | *.xsd.cs 338 | 339 | # OpenCover UI analysis results 340 | OpenCover/ 341 | 342 | # Azure Stream Analytics local run output 343 | ASALocalRun/ 344 | 345 | # MSBuild Binary and Structured Log 346 | *.binlog 347 | 348 | # NVidia Nsight GPU debugger configuration file 349 | *.nvuser 350 | 351 | # MFractors (Xamarin productivity tool) working folder 352 | .mfractor/ 353 | 354 | # Local History for Visual Studio 355 | .localhistory/ 356 | 357 | # BeatPulse healthcheck temp database 358 | healthchecksdb 359 | 360 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 361 | MigrationBackup/ 362 | 363 | # Ionide (cross platform F# VS Code tools) working folder 364 | .ionide/ 365 | 366 | # End of https://www.toptal.com/developers/gitignore/api/csharp 367 | /.idea/.idea.YandexMusicResolver/.idea/ 368 | /.idea/.idea.Material.Icons/.idea/ 369 | /Material.Icons.Meta.dll 370 | /.idea/.idea.Material.Icons.Avalonia/.idea/ 371 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 SKProCH 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 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | ## Visual Studio Code specific files and folder 7 | .vscode/* 8 | !.vscode/settings.json 9 | !.vscode/tasks.json 10 | !.vscode/launch.json 11 | !.vscode/extensions.jsons 12 | 13 | # User-specific files 14 | *.suo 15 | *.user 16 | *.userosscache 17 | *.sln.docstates 18 | 19 | # User-specific files (MonoDevelop/Xamarin Studio) 20 | *.userprefs 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Dd]ebugPublic/ 25 | [Rr]elease/ 26 | [Rr]eleases/ 27 | x64/ 28 | x86/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUNIT 47 | *.VisualState.xml 48 | TestResult.xml 49 | 50 | # Build Results of an ATL Project 51 | [Dd]ebugPS/ 52 | [Rr]eleasePS/ 53 | dlldata.c 54 | 55 | # Benchmark Results 56 | BenchmarkDotNet.Artifacts/ 57 | 58 | # .NET Core 59 | project.lock.json 60 | project.fragment.lock.json 61 | artifacts/ 62 | **/Properties/launchSettings.json 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_i.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *.log 88 | *.vspscc 89 | *.vssscc 90 | .builds 91 | *.pidb 92 | *.svclog 93 | *.scc 94 | 95 | # Chutzpah Test files 96 | _Chutzpah* 97 | 98 | # Visual C++ cache files 99 | ipch/ 100 | *.aps 101 | *.ncb 102 | *.opendb 103 | *.opensdf 104 | *.sdf 105 | *.cachefile 106 | *.VC.db 107 | *.VC.VC.opendb 108 | 109 | # Visual Studio profiler 110 | *.psess 111 | *.vsp 112 | *.vspx 113 | *.sap 114 | 115 | # Visual Studio Trace Files 116 | *.e2e 117 | 118 | # TFS 2012 Local Workspace 119 | $tf/ 120 | 121 | # Guidance Automation Toolkit 122 | *.gpState 123 | 124 | # ReSharper is a .NET coding add-in 125 | _ReSharper*/ 126 | *.[Rr]e[Ss]harper 127 | *.DotSettings.user 128 | 129 | # JustCode is a .NET coding add-in 130 | .JustCode 131 | 132 | # TeamCity is a build add-in 133 | _TeamCity* 134 | 135 | # DotCover is a Code Coverage Tool 136 | *.dotCover 137 | 138 | # AxoCover is a Code Coverage Tool 139 | .axoCover/* 140 | !.axoCover/settings.json 141 | 142 | # Visual Studio code coverage results 143 | *.coverage 144 | *.coveragexml 145 | 146 | # NCrunch 147 | _NCrunch_* 148 | .*crunch*.local.xml 149 | nCrunchTemp_* 150 | 151 | # MightyMoose 152 | *.mm.* 153 | AutoTest.Net/ 154 | 155 | # Web workbench (sass) 156 | .sass-cache/ 157 | 158 | # Installshield output folder 159 | [Ee]xpress/ 160 | 161 | # DocProject is a documentation generator add-in 162 | DocProject/buildhelp/ 163 | DocProject/Help/*.HxT 164 | DocProject/Help/*.HxC 165 | DocProject/Help/*.hhc 166 | DocProject/Help/*.hhk 167 | DocProject/Help/*.hhp 168 | DocProject/Help/Html2 169 | DocProject/Help/html 170 | 171 | # Click-Once directory 172 | publish/ 173 | 174 | # Publish Web Output 175 | *.[Pp]ublish.xml 176 | *.azurePubxml 177 | # Note: Comment the next line if you want to checkin your web deploy settings, 178 | # but database connection strings (with potential passwords) will be unencrypted 179 | *.pubxml 180 | *.publishproj 181 | 182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 183 | # checkin your Azure Web App publish settings, but sensitive information contained 184 | # in these scripts will be unencrypted 185 | PublishScripts/ 186 | 187 | # NuGet Packages 188 | *.nupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | 214 | # Visual Studio cache files 215 | # files ending in .cache can be ignored 216 | *.[Cc]ache 217 | # but keep track of directories ending in .cache 218 | !*.[Cc]ache/ 219 | 220 | # Others 221 | ClientBin/ 222 | ~$* 223 | *~ 224 | *.dbmdl 225 | *.dbproj.schemaview 226 | *.jfm 227 | *.pfx 228 | *.publishsettings 229 | orleans.codegen.cs 230 | 231 | # Including strong name files can present a security risk 232 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 233 | #*.snk 234 | 235 | # Since there are multiple workflows, uncomment next line to ignore bower_components 236 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 237 | #bower_components/ 238 | 239 | # RIA/Silverlight projects 240 | Generated_Code/ 241 | 242 | # Backup & report files from converting an old project file 243 | # to a newer Visual Studio version. Backup files are not needed, 244 | # because we have git ;-) 245 | _UpgradeReport_Files/ 246 | Backup*/ 247 | UpgradeLog*.XML 248 | UpgradeLog*.htm 249 | ServiceFabricBackup/ 250 | *.rptproj.bak 251 | 252 | # SQL Server files 253 | *.mdf 254 | *.ldf 255 | *.ndf 256 | 257 | # Business Intelligence projects 258 | *.rdl.data 259 | *.bim.layout 260 | *.bim_*.settings 261 | *.rptproj.rsuser 262 | 263 | # Microsoft Fakes 264 | FakesAssemblies/ 265 | 266 | # GhostDoc plugin setting file 267 | *.GhostDoc.xml 268 | 269 | # Node.js Tools for Visual Studio 270 | .ntvs_analysis.dat 271 | node_modules/ 272 | 273 | # Visual Studio 6 build log 274 | *.plg 275 | 276 | # Visual Studio 6 workspace options file 277 | *.opt 278 | 279 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 280 | *.vbw 281 | 282 | # Visual Studio LightSwitch build output 283 | **/*.HTMLClient/GeneratedArtifacts 284 | **/*.DesktopClient/GeneratedArtifacts 285 | **/*.DesktopClient/ModelManifest.xml 286 | **/*.Server/GeneratedArtifacts 287 | **/*.Server/ModelManifest.xml 288 | _Pvt_Extensions 289 | 290 | # Paket dependency manager 291 | .paket/paket.exe 292 | paket-files/ 293 | 294 | # FAKE - F# Make 295 | .fake/ 296 | 297 | # JetBrains Rider 298 | .idea/ 299 | *.sln.iml 300 | 301 | # CodeRush 302 | .cr/ 303 | 304 | # Python Tools for Visual Studio (PTVS) 305 | __pycache__/ 306 | *.pyc 307 | 308 | # Cake - Uncomment if you are using it 309 | # tools/** 310 | # !tools/packages.config 311 | 312 | # Tabs Studio 313 | *.tss 314 | 315 | # Telerik's JustMock configuration file 316 | *.jmconfig 317 | 318 | # BizTalk build output 319 | *.btp.cs 320 | *.btm.cs 321 | *.odx.cs 322 | *.xsd.cs 323 | 324 | # OpenCover UI analysis results 325 | OpenCover/ 326 | 327 | # Azure Stream Analytics local run output 328 | ASALocalRun/ 329 | 330 | # MSBuild Binary and Structured Log 331 | *.binlog 332 | 333 | # NVidia Nsight GPU debugger configuration file 334 | *.nvuser 335 | 336 | # MFractors (Xamarin productivity tool) working folder 337 | .mfractor/ 338 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Controls.ApplicationLifetimes; 3 | using Avalonia.Markup.Xaml; 4 | using Material.Icons.Avalonia.Demo.ViewModels; 5 | using Material.Icons.Avalonia.Demo.Views; 6 | 7 | namespace Material.Icons.Avalonia.Demo { 8 | public class App : Application { 9 | public override void Initialize() { 10 | AvaloniaXamlLoader.Load(this); 11 | } 12 | 13 | public override void OnFrameworkInitializationCompleted() { 14 | if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { 15 | desktop.MainWindow = new MainWindow { 16 | DataContext = new MainWindowViewModel(), 17 | }; 18 | } 19 | 20 | base.OnFrameworkInitializationCompleted(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AvaloniaUtils/Material.Icons.Avalonia/e3004a5b092ac687c39461daba6567ccb84d9fbf/Material.Icons.Avalonia.Demo/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/Controls/SelectionWrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Avalonia; 3 | using Avalonia.Controls; 4 | using Avalonia.Controls.Metadata; 5 | 6 | namespace Material.Icons.Avalonia.Demo.Controls { 7 | [PseudoClasses("selectednow")] 8 | public class SelectionWrapper : UserControl { 9 | static SelectionWrapper() { 10 | PointerPressedEvent.Raised.Subscribe(tuple => { 11 | if (tuple.Item1 is SelectionWrapper selectionWrapper) { 12 | selectionWrapper.CurrentSelected = selectionWrapper.DataSource; 13 | } 14 | }); 15 | 16 | CurrentSelectedProperty.Changed.Subscribe(args => { 17 | if (args.Sender is SelectionWrapper selectionWrapper) { 18 | selectionWrapper.UpdateSelectedNow(); 19 | } 20 | }); 21 | 22 | SelectedNowProperty.Changed.Subscribe(args => { 23 | if (args.Sender is SelectionWrapper selectionWrapper) { 24 | if (args.NewValue.Value) { 25 | selectionWrapper.PseudoClasses.Add(":selectednow"); 26 | } 27 | else { 28 | selectionWrapper.PseudoClasses.Remove(":selectednow"); 29 | } 30 | } 31 | }); 32 | } 33 | 34 | protected override void OnDataContextEndUpdate() { 35 | base.OnDataContextEndUpdate(); 36 | UpdateSelectedNow(); 37 | } 38 | 39 | public void UpdateSelectedNow() { 40 | SelectedNow = DataSource != null && DataSource == CurrentSelected; 41 | } 42 | 43 | public static readonly StyledProperty DataSourceProperty = AvaloniaProperty.Register(nameof(DataSource)); 44 | 45 | public object DataSource { 46 | get => GetValue(DataSourceProperty); 47 | set => SetValue(DataSourceProperty, value); 48 | } 49 | 50 | public static readonly StyledProperty CurrentSelectedProperty = AvaloniaProperty.Register(nameof(CurrentSelected)); 51 | 52 | public object CurrentSelected { 53 | get => GetValue(CurrentSelectedProperty); 54 | set => SetValue(CurrentSelectedProperty, value); 55 | } 56 | 57 | public static readonly DirectProperty SelectedNowProperty = AvaloniaProperty.RegisterDirect( 58 | nameof(SelectedNow), 59 | wrapper => wrapper.CurrentSelected == wrapper.DataSource); 60 | 61 | private bool _selectedNow; 62 | 63 | public bool SelectedNow { 64 | get => _selectedNow; 65 | private set => SetAndRaise(SelectedNowProperty, ref _selectedNow, value); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/Material.Icons.Avalonia.Demo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | WinExe 4 | netcoreapp3.0 5 | enable 6 | 7 | 8 | 9 | 10 | %(Filename) 11 | 12 | 13 | Designer 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/Models/PackIconKindGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Material.Icons.Avalonia.Demo.Models { 6 | public class PackIconKindGroup { 7 | public PackIconKindGroup(IEnumerable kinds) { 8 | if (kinds is null) throw new ArgumentNullException(nameof(kinds)); 9 | var allValues = kinds.ToList(); 10 | if (!allValues.Any()) throw new ArgumentException($"{nameof(kinds)} must contain at least one value"); 11 | Kind = allValues.First(); 12 | Aliases = allValues 13 | .OrderBy(x => x, StringComparer.InvariantCultureIgnoreCase) 14 | .ToArray(); 15 | } 16 | 17 | public string Kind { get; } 18 | public string[] Aliases { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/Models/StringJoinConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Globalization; 4 | using System.Linq; 5 | using Avalonia.Data.Converters; 6 | 7 | namespace Material.Icons.Avalonia.Demo.Models { 8 | public class StringJoinConverter : IValueConverter { 9 | public string? Separator { get; set; } 10 | 11 | public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { 12 | IEnumerable values = value as IEnumerable ?? Array.Empty(); 13 | return string.Join(Separator ?? "", values.OfType()); 14 | } 15 | 16 | public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { 17 | throw new NotSupportedException(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/Program.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.ReactiveUI; 3 | 4 | namespace Material.Icons.Avalonia.Demo { 5 | class Program { 6 | // Initialization code. Don't use any Avalonia, third-party APIs or any 7 | // SynchronizationContext-reliant code before AppMain is called: things aren't initialized 8 | // yet and stuff might break. 9 | public static void Main(string[] args) => BuildAvaloniaApp() 10 | .StartWithClassicDesktopLifetime(args); 11 | 12 | // Avalonia configuration, don't remove; also used by visual designer. 13 | public static AppBuilder BuildAvaloniaApp() 14 | => AppBuilder.Configure() 15 | .UsePlatformDetect() 16 | .LogToTrace() 17 | .UseReactiveUI(); 18 | } 19 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/ViewLocator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The Avalonia Project. All rights reserved. 2 | // Licensed under the MIT license. See licence.md file in the project root for full license information. 3 | 4 | using System; 5 | using Avalonia.Controls; 6 | using Avalonia.Controls.Templates; 7 | using Material.Icons.Avalonia.Demo.ViewModels; 8 | 9 | #pragma warning disable 8600 10 | #pragma warning disable 8602 11 | #pragma warning disable 8603 12 | 13 | namespace Material.Icons.Avalonia.Demo { 14 | public class ViewLocator : IDataTemplate { 15 | public bool SupportsRecycling => false; 16 | 17 | public IControl Build(object data) { 18 | var name = data.GetType().FullName.Replace("ViewModel", "View"); 19 | var type = Type.GetType(name); 20 | 21 | if (type != null) { 22 | return (Control) Activator.CreateInstance(type); 23 | } 24 | else { 25 | return new TextBlock {Text = "Not Found: " + name}; 26 | } 27 | } 28 | 29 | public bool Match(object data) { 30 | return data is ViewModelBase; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/ViewModels/MainWindowViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reactive.Linq; 5 | using System.Reactive.Subjects; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using Avalonia.Controls; 9 | using DynamicData.Binding; 10 | using Material.Icons.Avalonia.Demo.Models; 11 | using ReactiveUI; 12 | 13 | namespace Material.Icons.Avalonia.Demo.ViewModels { 14 | public class MainWindowViewModel : ViewModelBase { 15 | private readonly Lazy> _packIconKinds; 16 | private IEnumerable? _kinds; 17 | private PackIconKindGroup? _group; 18 | private string? _searchText; 19 | 20 | public MainWindowViewModel() { 21 | _packIconKinds = new Lazy>(() => 22 | Enum.GetNames(typeof(MaterialIconKind)) 23 | .GroupBy(k => (MaterialIconKind) Enum.Parse(typeof(MaterialIconKind), k)) 24 | .Select(g => new PackIconKindGroup(g)) 25 | .OrderBy(x => x.Kind) 26 | .ToList()); 27 | 28 | this.WhenValueChanged(model => model.SearchText).Subscribe(DoSearch); 29 | CopyText = this.WhenValueChanged(model => model.Group).Where(group => group != null).Select(group => $""); 30 | } 31 | 32 | private async void DoSearch(string text) { 33 | if (string.IsNullOrWhiteSpace(text)) 34 | Kinds = _packIconKinds.Value; 35 | else { 36 | Kinds = new List(); 37 | Kinds = await Task.Run(() => 38 | _packIconKinds.Value 39 | .Where(x => x.Aliases.Any(a => a.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) >= 0)) 40 | .ToList()); 41 | } 42 | } 43 | 44 | public IEnumerable Kinds { 45 | get => _kinds ?? _packIconKinds.Value; 46 | set => this.RaiseAndSetIfChanged(ref _kinds, value); 47 | } 48 | 49 | public PackIconKindGroup? Group { 50 | get => _group; 51 | set => this.RaiseAndSetIfChanged(ref _group, value); 52 | } 53 | 54 | public string? SearchText { 55 | get => _searchText; 56 | set => this.RaiseAndSetIfChanged(ref _searchText, value); 57 | } 58 | 59 | public IObservable CopyText { get; set; } 60 | } 61 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/ViewModels/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using ReactiveUI; 5 | 6 | namespace Material.Icons.Avalonia.Demo.ViewModels { 7 | public class ViewModelBase : ReactiveObject { } 8 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/Views/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 40 | 41 | 46 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/Views/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Controls; 3 | using Avalonia.Diagnostics; 4 | using Avalonia.Input; 5 | using Avalonia.Markup.Xaml; 6 | 7 | namespace Material.Icons.Avalonia.Demo.Views { 8 | public class MainWindow : Window { 9 | public MainWindow() { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() { 14 | AvaloniaXamlLoader.Load(this); 15 | DevTools.Attach(this, KeyGesture.Parse("F12")); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia.Demo/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Material.Icons.Avalonia", "Material.Icons.Avalonia\Material.Icons.Avalonia.csproj", "{6FCAB4B3-A6F8-4243-96CD-B9DB32AF6B2F}" 4 | EndProject 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Material.Icons.Avalonia.Demo", "Material.Icons.Avalonia.Demo\Material.Icons.Avalonia.Demo.csproj", "{BB8514A2-0293-4340-9C33-486EE9193851}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {6FCAB4B3-A6F8-4243-96CD-B9DB32AF6B2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 14 | {6FCAB4B3-A6F8-4243-96CD-B9DB32AF6B2F}.Debug|Any CPU.Build.0 = Debug|Any CPU 15 | {6FCAB4B3-A6F8-4243-96CD-B9DB32AF6B2F}.Release|Any CPU.ActiveCfg = Release|Any CPU 16 | {6FCAB4B3-A6F8-4243-96CD-B9DB32AF6B2F}.Release|Any CPU.Build.0 = Release|Any CPU 17 | {BB8514A2-0293-4340-9C33-486EE9193851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 18 | {BB8514A2-0293-4340-9C33-486EE9193851}.Debug|Any CPU.Build.0 = Debug|Any CPU 19 | {BB8514A2-0293-4340-9C33-486EE9193851}.Release|Any CPU.ActiveCfg = Release|Any CPU 20 | {BB8514A2-0293-4340-9C33-486EE9193851}.Release|Any CPU.Build.0 = Release|Any CPU 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | ## Visual Studio Code specific files and folder 7 | .vscode/* 8 | !.vscode/settings.json 9 | !.vscode/tasks.json 10 | !.vscode/launch.json 11 | !.vscode/extensions.jsons 12 | 13 | # User-specific files 14 | *.suo 15 | *.user 16 | *.userosscache 17 | *.sln.docstates 18 | 19 | # User-specific files (MonoDevelop/Xamarin Studio) 20 | *.userprefs 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Dd]ebugPublic/ 25 | [Rr]elease/ 26 | [Rr]eleases/ 27 | x64/ 28 | x86/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUNIT 47 | *.VisualState.xml 48 | TestResult.xml 49 | 50 | # Build Results of an ATL Project 51 | [Dd]ebugPS/ 52 | [Rr]eleasePS/ 53 | dlldata.c 54 | 55 | # Benchmark Results 56 | BenchmarkDotNet.Artifacts/ 57 | 58 | # .NET Core 59 | project.lock.json 60 | project.fragment.lock.json 61 | artifacts/ 62 | **/Properties/launchSettings.json 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_i.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *.log 88 | *.vspscc 89 | *.vssscc 90 | .builds 91 | *.pidb 92 | *.svclog 93 | *.scc 94 | 95 | # Chutzpah Test files 96 | _Chutzpah* 97 | 98 | # Visual C++ cache files 99 | ipch/ 100 | *.aps 101 | *.ncb 102 | *.opendb 103 | *.opensdf 104 | *.sdf 105 | *.cachefile 106 | *.VC.db 107 | *.VC.VC.opendb 108 | 109 | # Visual Studio profiler 110 | *.psess 111 | *.vsp 112 | *.vspx 113 | *.sap 114 | 115 | # Visual Studio Trace Files 116 | *.e2e 117 | 118 | # TFS 2012 Local Workspace 119 | $tf/ 120 | 121 | # Guidance Automation Toolkit 122 | *.gpState 123 | 124 | # ReSharper is a .NET coding add-in 125 | _ReSharper*/ 126 | *.[Rr]e[Ss]harper 127 | *.DotSettings.user 128 | 129 | # JustCode is a .NET coding add-in 130 | .JustCode 131 | 132 | # TeamCity is a build add-in 133 | _TeamCity* 134 | 135 | # DotCover is a Code Coverage Tool 136 | *.dotCover 137 | 138 | # AxoCover is a Code Coverage Tool 139 | .axoCover/* 140 | !.axoCover/settings.json 141 | 142 | # Visual Studio code coverage results 143 | *.coverage 144 | *.coveragexml 145 | 146 | # NCrunch 147 | _NCrunch_* 148 | .*crunch*.local.xml 149 | nCrunchTemp_* 150 | 151 | # MightyMoose 152 | *.mm.* 153 | AutoTest.Net/ 154 | 155 | # Web workbench (sass) 156 | .sass-cache/ 157 | 158 | # Installshield output folder 159 | [Ee]xpress/ 160 | 161 | # DocProject is a documentation generator add-in 162 | DocProject/buildhelp/ 163 | DocProject/Help/*.HxT 164 | DocProject/Help/*.HxC 165 | DocProject/Help/*.hhc 166 | DocProject/Help/*.hhk 167 | DocProject/Help/*.hhp 168 | DocProject/Help/Html2 169 | DocProject/Help/html 170 | 171 | # Click-Once directory 172 | publish/ 173 | 174 | # Publish Web Output 175 | *.[Pp]ublish.xml 176 | *.azurePubxml 177 | # Note: Comment the next line if you want to checkin your web deploy settings, 178 | # but database connection strings (with potential passwords) will be unencrypted 179 | *.pubxml 180 | *.publishproj 181 | 182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 183 | # checkin your Azure Web App publish settings, but sensitive information contained 184 | # in these scripts will be unencrypted 185 | PublishScripts/ 186 | 187 | # NuGet Packages 188 | *.nupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | 214 | # Visual Studio cache files 215 | # files ending in .cache can be ignored 216 | *.[Cc]ache 217 | # but keep track of directories ending in .cache 218 | !*.[Cc]ache/ 219 | 220 | # Others 221 | ClientBin/ 222 | ~$* 223 | *~ 224 | *.dbmdl 225 | *.dbproj.schemaview 226 | *.jfm 227 | *.pfx 228 | *.publishsettings 229 | orleans.codegen.cs 230 | 231 | # Including strong name files can present a security risk 232 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 233 | #*.snk 234 | 235 | # Since there are multiple workflows, uncomment next line to ignore bower_components 236 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 237 | #bower_components/ 238 | 239 | # RIA/Silverlight projects 240 | Generated_Code/ 241 | 242 | # Backup & report files from converting an old project file 243 | # to a newer Visual Studio version. Backup files are not needed, 244 | # because we have git ;-) 245 | _UpgradeReport_Files/ 246 | Backup*/ 247 | UpgradeLog*.XML 248 | UpgradeLog*.htm 249 | ServiceFabricBackup/ 250 | *.rptproj.bak 251 | 252 | # SQL Server files 253 | *.mdf 254 | *.ldf 255 | *.ndf 256 | 257 | # Business Intelligence projects 258 | *.rdl.data 259 | *.bim.layout 260 | *.bim_*.settings 261 | *.rptproj.rsuser 262 | 263 | # Microsoft Fakes 264 | FakesAssemblies/ 265 | 266 | # GhostDoc plugin setting file 267 | *.GhostDoc.xml 268 | 269 | # Node.js Tools for Visual Studio 270 | .ntvs_analysis.dat 271 | node_modules/ 272 | 273 | # Visual Studio 6 build log 274 | *.plg 275 | 276 | # Visual Studio 6 workspace options file 277 | *.opt 278 | 279 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 280 | *.vbw 281 | 282 | # Visual Studio LightSwitch build output 283 | **/*.HTMLClient/GeneratedArtifacts 284 | **/*.DesktopClient/GeneratedArtifacts 285 | **/*.DesktopClient/ModelManifest.xml 286 | **/*.Server/GeneratedArtifacts 287 | **/*.Server/ModelManifest.xml 288 | _Pvt_Extensions 289 | 290 | # Paket dependency manager 291 | .paket/paket.exe 292 | paket-files/ 293 | 294 | # FAKE - F# Make 295 | .fake/ 296 | 297 | # JetBrains Rider 298 | .idea/ 299 | *.sln.iml 300 | 301 | # CodeRush 302 | .cr/ 303 | 304 | # Python Tools for Visual Studio (PTVS) 305 | __pycache__/ 306 | *.pyc 307 | 308 | # Cake - Uncomment if you are using it 309 | # tools/** 310 | # !tools/packages.config 311 | 312 | # Tabs Studio 313 | *.tss 314 | 315 | # Telerik's JustMock configuration file 316 | *.jmconfig 317 | 318 | # BizTalk build output 319 | *.btp.cs 320 | *.btm.cs 321 | *.odx.cs 322 | *.xsd.cs 323 | 324 | # OpenCover UI analysis results 325 | OpenCover/ 326 | 327 | # Azure Stream Analytics local run output 328 | ASALocalRun/ 329 | 330 | # MSBuild Binary and Structured Log 331 | *.binlog 332 | 333 | # NVidia Nsight GPU debugger configuration file 334 | *.nvuser 335 | 336 | # MFractors (Xamarin productivity tool) working folder 337 | .mfractor/ 338 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia/App.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Styling; 2 | 3 | namespace Material.Icons.Avalonia { 4 | public class App : Styles { } 5 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia/GeometryConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Avalonia.Data; 4 | using Avalonia.Data.Converters; 5 | using Avalonia.Media; 6 | 7 | namespace Material.Icons.Avalonia { 8 | public class GeometryConverter : IValueConverter { 9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { 10 | if (value is string s) { 11 | return Geometry.Parse(s); 12 | } 13 | 14 | return BindingOperations.DoNothing; 15 | } 16 | 17 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { 18 | throw new NotSupportedException(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia/Material.Icons.Avalonia.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | netstandard2.0 4 | 9 5 | enable 6 | true 7 | Material.Icons.Avalonia 8 | SKProCH 9 | Avalonia control for display material icons from Material.Icons 10 | https://github.com/AvaloniaUtils/Material.Icons.Avalonia/ 11 | https://github.com/AvaloniaUtils/Material.Icons.Avalonia/blob/master/LICENSE 12 | https://github.com/AvaloniaUtils/Material.Icons.Avalonia.git 13 | Git 14 | material icons material-design google-material avalonia 15 | 1.2.0 16 | 17 | 18 | 19 | %(Filename) 20 | 21 | 22 | Designer 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia/MaterialIcon.xaml: -------------------------------------------------------------------------------- 1 |  4 | 27 | -------------------------------------------------------------------------------- /Material.Icons.Avalonia/MaterialIcon.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using Avalonia; 5 | using Avalonia.Controls; 6 | using Avalonia.Controls.Primitives; 7 | 8 | namespace Material.Icons.Avalonia { 9 | public class MaterialIcon : TemplatedControl { 10 | private static readonly Lazy> _dataIndex = new(MaterialIconDataFactory.DataSetCreate); 11 | 12 | static MaterialIcon() { 13 | KindProperty.Changed.Subscribe(args => (args.Sender as MaterialIcon)?.UpdateData()); 14 | } 15 | 16 | public static readonly AvaloniaProperty KindProperty = AvaloniaProperty.Register(nameof(Kind)); 17 | 18 | /// 19 | /// Gets or sets the icon to display. 20 | /// 21 | public MaterialIconKind Kind { 22 | get => (MaterialIconKind) GetValue(KindProperty); 23 | set => SetValue(KindProperty, value); 24 | } 25 | 26 | private static readonly AvaloniaProperty 27 | DataProperty = AvaloniaProperty.RegisterDirect(nameof(Data), icon => icon.Data); 28 | 29 | private string? _data; 30 | 31 | /// 32 | /// Gets the icon path data for the current . 33 | /// 34 | public string? Data { 35 | get => _data; 36 | private set => SetAndRaise(DataProperty, ref _data, value); 37 | } 38 | 39 | protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { 40 | base.OnApplyTemplate(e); 41 | UpdateData(); 42 | } 43 | 44 | private void UpdateData() { 45 | string? data = null; 46 | _dataIndex.Value?.TryGetValue(Kind, out data); 47 | Data = data; 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /Material.Icons.Avalonia/MaterialIconExt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace Material.Icons.Avalonia { 5 | public class MaterialIconExt : MarkupExtension { 6 | public MaterialIconExt() { } 7 | public MaterialIconExt(MaterialIconKind kind) { 8 | Kind = kind; 9 | } 10 | 11 | public MaterialIconExt(MaterialIconKind kind, double? size) { 12 | Kind = kind; 13 | Size = size; 14 | } 15 | 16 | [ConstructorArgument("kind")] 17 | public MaterialIconKind Kind { get; set; } 18 | 19 | [ConstructorArgument("size")] 20 | public double? Size { get; set; } 21 | 22 | public override object ProvideValue(IServiceProvider serviceProvider) { 23 | var result = new MaterialIcon { Kind = Kind }; 24 | 25 | if (Size.HasValue) 26 | { 27 | result.Height = Size.Value; 28 | result.Width = Size.Value; 29 | } 30 | 31 | return result; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Material.Icons.Avalonia moved back to original [Material.Icons](https://github.com/SKProCH/Material.Icons) repository 2 | 3 | # Material.Icons.Avalonia 4 | Avalonia control for display material icons from [Material.Icons](https://github.com/SKProCH/Material.Icons). 5 | Icons list can be found on the [materialdesignicons.com](https://materialdesignicons.com/) or in the demo application. 6 | 7 | ### Getting started 8 | Install [Material.Icons.Avalonia nuget package](https://www.nuget.org/packages/Material.Icons.Avalonia/): 9 | ``` 10 | dotnet add package Material.Icons.Avalonia 11 | ``` 12 | Include styles in `App.xaml` 13 | ```xml 14 | 15 | 16 | ... 17 | 18 | 19 | 20 | ``` 21 | ### Using 22 | Use `MaterialIcon` control: 23 | ``` 24 | xmlns:material="using:Material.Icons.Avalonia" 25 | ``` 26 | ```xml 27 | 28 | ``` 29 | The `Foreground` property controls the color of the icon. 30 | --------------------------------------------------------------------------------