Skip to content

Commit

Permalink
Merge pull request #434 from AndreasReitberger/433-add-syncfusionmaui…
Browse files Browse the repository at this point in the history
…barcode

Added `SfBarcodeGenerator`
  • Loading branch information
AndreasReitberger authored Feb 15, 2024
2 parents e0aa56b + 4099406 commit c2d063c
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
@@ -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" />
Original file line number Diff line number Diff line change
@@ -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" />
@@ -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>

0 comments on commit c2d063c

Please sign in to comment.