Skip to content

Commit

Permalink
Added SfBarcodeGenerator
Browse files Browse the repository at this point in the history
This commit adds the `SfBarcodeGenerator` to the shared library.

Fixed #433
  • Loading branch information
AndreasReitberger committed Feb 15, 2024
1 parent e0aa56b commit 4099406
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xaml-comp compile="true" ?>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

xmlns:converters="clr-namespace:AndreasReitberger.Shared.Core.Converters;assembly=SharedMauiCoreLibrary"
xmlns:shared="clr-namespace:AndreasReitberger.Shared;assembly=SharedMauiXamlStylesLibrary"
xmlns:icons="clr-namespace:AndreasReitberger.Shared.Syncfusion.FontIcons"
xmlns:iconsCore="clr-namespace:AndreasReitberger.Shared.FontIcons;assembly=SharedMauiXamlStylesLibrary"

xmlns:core="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:barcode="clr-namespace:Syncfusion.Maui.Barcode;assembly=Syncfusion.Maui.Barcode"
>
<ResourceDictionary.MergedDictionaries>
<shared:Colors />
<shared:Fonts />
<ResourceDictionary Source="/Resources/Themes/SharedFonts.xaml" />
</ResourceDictionary.MergedDictionaries>

<converters:BrushToBlackWhiteConverter x:Key="BrushToBlackWhiteConverter"/>

<!-- Docs: https://help.syncfusion.com/maui/barcode-generator/getting-started -->
<Style x:Key="Style.Syncfusion.SfBarcodeGenerator.Default" TargetType="barcode:SfBarcodeGenerator">
<Setter Property="ShowText" Value="True" />
<Setter Property="Background" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" />
<Setter Property="ForegroundColor" Value="{Binding Source={RelativeSource Self}, Path=Background, Converter={StaticResource BrushToBlackWhiteConverter}}" />
<Setter Property="TextStyle">
<Setter.Value>
<barcode:BarcodeTextStyle
FontFamily="{StaticResource MontserratRegular}"
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
FontSize="8"
/>
</Setter.Value>
</Setter>
</Style>

<Style TargetType="barcode:SfBarcodeGenerator" BasedOn="{StaticResource Style.Syncfusion.SfBarcodeGenerator.Default}"/>

<Style x:Key="Style.Syncfusion.SfBarcodeGenerator.QRCode" TargetType="barcode:SfBarcodeGenerator" BasedOn="{StaticResource Style.Syncfusion.SfBarcodeGenerator.Default}">
<Setter Property="Symbology">
<Setter.Value>
<barcode:QRCode />
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ResourceDictionary Source="/Resources/Themes/Controls/SfAccordion.xaml" />
<ResourceDictionary Source="/Resources/Themes/Controls/SfAutoComplete.xaml" />
<ResourceDictionary Source="/Resources/Themes/Controls/SfBadgeView.xaml" />
<ResourceDictionary Source="/Resources/Themes/Controls/SfBarcodeGenerator.xaml" />
<ResourceDictionary Source="/Resources/Themes/Controls/SfBusyIndicator.xaml" />
<ResourceDictionary Source="/Resources/Themes/Controls/SfButton.xaml" />
<ResourceDictionary Source="/Resources/Themes/Controls/SfCartesianChart.xaml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

<ItemGroup>
<ProjectReference Include="..\SharedMauiXamlStylesLibrary\SharedMauiXamlStylesLibrary.csproj" />
<PackageReference Include="Syncfusion.Maui.Barcode" Version="24.2.6" />
<PackageReference Include="Syncfusion.Maui.Buttons" Version="24.2.6" />
<PackageReference Include="Syncfusion.Maui.Charts" Version="24.2.6" />
<PackageReference Include="Syncfusion.Maui.Core" Version="24.2.6" />
Expand Down Expand Up @@ -111,6 +112,9 @@
</ItemGroup>

<ItemGroup>
<MauiXaml Update="Resources\Themes\Controls\SfBarcodeGenerator.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Resources\Themes\Controls\SfButton.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
Expand Down

0 comments on commit 4099406

Please sign in to comment.