Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

8 місяці тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. [icons-nuget]: https://www.nuget.org/packages/Material.Icons/
  2. [wpf-nuget]: https://www.nuget.org/packages/Material.Icons.WPF/
  3. [avalonia-nuget]: https://www.nuget.org/packages/Material.Icons.Avalonia/
  4. # Material.Icons
  5. Parsed icons set from [materialdesignicons.com](https://materialdesignicons.com/) and display control implementations for different GUI frameworks.
  6. - All icons are **always up-to-date** because automatically updated every 6 hours.
  7. - **Small package size** because icons are graphically encoded via SVG Path.
  8. - Icon types are **strongly typed** enum, so your **IDE will suggest available variants**:
  9. ![895428ad-6010-4ffd-bd88-61aecd50f5e1](https://user-images.githubusercontent.com/29896317/213889827-ca4f7673-115a-433e-9fde-305d55d36772.gif)
  10. ## Structure
  11. This project consists of 3 parts:
  12. - [![](https://img.shields.io/nuget/dt/Material.Icons?label=Material.Icons&style=flat-square)](#meta) contains info about the icons
  13. - [![](https://img.shields.io/nuget/dt/Material.Icons.Avalonia?color=blue&label=Material.Icons.Avalonia&style=flat-square)](#avalonia) contains controls for **AvaloniaUI**
  14. - [![](https://img.shields.io/nuget/dt/Material.Icons.WPF?color=blue&label=Material.Icons.WPF&style=flat-square)](#wpf) contains controls for **WPF**
  15. - [FAQ](#faq) - frequently asked questions
  16. ## Avalonia
  17. #### Getting started
  18. 1. Install [Material.Icons.Avalonia nuget package](https://www.nuget.org/packages/Material.Icons.Avalonia/):
  19. ```shell
  20. dotnet add package Material.Icons.Avalonia
  21. ```
  22. [![avalonia-nuget](https://img.shields.io/nuget/v/Material.Icons.Avalonia?label=Material.Icons.Avalonia&style=flat-square)][avalonia-nuget]
  23. [![avalonia-nuget](https://img.shields.io/nuget/dt/Material.Icons.Avalonia?color=blue&label=Downloads&style=flat-square)][avalonia-nuget]
  24. 2. Include styles in `App.xaml` (for `2.0.0` version and higher):
  25. ```xaml
  26. <Application xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
  27. ...>
  28. <Application.Styles>
  29. ...
  30. <materialIcons:MaterialIconStyles />
  31. </Application.Styles>
  32. </Application>
  33. ```
  34. For `1.*.*`:
  35. ```xaml
  36. <Application ...>
  37. <Application.Styles>
  38. ...
  39. <StyleInclude Source="avares://Material.Icons.Avalonia/App.xaml" />
  40. </Application.Styles>
  41. </Application>
  42. ```
  43. #### Using
  44. Add `Material.Icons.Avalonia` namespace to the root element of your file (your IDE can suggest it or do it automatically):
  45. ```
  46. xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
  47. ```
  48. Use `MaterialIcon` control:
  49. ```xaml
  50. <materialIcons:MaterialIcon Kind="Abacus" />
  51. ```
  52. The `Foreground` property controls the color of the icon.
  53. Also, there is `MaterialIconExt` which allows you to use is as the markup extension:
  54. ```xaml
  55. <Button Content="{materialIcons:MaterialIconExt Kind=Abacus}" />
  56. ```
  57. ## WPF
  58. #### Getting started
  59. Install [Material.Icons.WPF nuget package](https://www.nuget.org/packages/Material.Icons.WPF/):
  60. ```shell
  61. dotnet add package Material.Icons.WPF
  62. ```
  63. [![wpf-nuget](https://img.shields.io/nuget/v/Material.Icons.WPF?label=Material.Icons.WPF&style=flat-square)][wpf-nuget]
  64. [![wpf-nuget](https://img.shields.io/nuget/dt/Material.Icons.WPF?color=blue&label=Downloads&style=flat-square)][wpf-nuget]
  65. #### Using
  66. Add `Material.Icons.WPF` namespace to the root element of your file (your IDE can suggest it or do it automatically):
  67. ```
  68. xmlns:materialIcons="clr-namespace:Material.Icons.WPF;assembly=Material.Icons.WPF"
  69. ```
  70. Use `MaterialIcon` control:
  71. ```xaml
  72. <materialIcons:MaterialIcon Kind="Abacus" />
  73. ```
  74. The `Foreground` property controls the color of the icon.
  75. Also, there is `MaterialIconExt` which allows you to use is as the markup extension:
  76. ```xaml
  77. <Button Content="{materialIcons:MaterialIconExt Kind=Abacus}" />
  78. ```
  79. ## Meta
  80. #### Getting started
  81. Install [Material.Icons nuget package](https://www.nuget.org/packages/Material.Icons/):
  82. ```shell
  83. dotnet add package Material.Icons
  84. ```
  85. [![icons-nuget](https://img.shields.io/nuget/v/Material.Icons?label=Material.Icons&style=flat-square)][icons-nuget]
  86. [![icons-nuget](https://img.shields.io/nuget/dt/Material.Icons?color=blue&label=Downloads&style=flat-square)][icons-nuget]
  87. #### Using
  88. Icon types stored in `Material.Icons.MaterialIconKind` enum.
  89. We can resolve an icon path by using `Material.Icons.MaterialIconDataProvider.GetData()`.
  90. ## FAQ
  91. #### How to change icon color?
  92. - Change `Foreground` property.
  93. #### How to update icons?
  94. - You can manually set `Material.Icons` package version in your project file.
  95. #### What about versioning policy?
  96. - We use semver.
  97. Any package with identical major and minor versions is compatible.
  98. For example, `1.0.0` and `1.0.1` are compatible, but `1.0.0` and `1.1.0` might not be.