-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #397 from AndreasReitberger/396-add-sfpicker-style…
…s-for-syncfusion Added new `SfPicker` styles
- Loading branch information
Showing
10 changed files
with
172 additions
and
17 deletions.
There are no files selected for viewing
143 changes: 143 additions & 0 deletions
143
src/SharedMauiXamlStylesLibrary.Syncfusion/Resources/Themes/Controls/SfPicker.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<?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:picker="clr-namespace:Syncfusion.Maui.Picker;assembly=Syncfusion.Maui.Picker" | ||
xmlns:shared="clr-namespace:AndreasReitberger.Shared;assembly=SharedMauiXamlStylesLibrary" | ||
> | ||
<ResourceDictionary.MergedDictionaries> | ||
<shared:Colors /> | ||
<shared:Fonts /> | ||
<ResourceDictionary Source="/Resources/Themes/SharedFonts.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
|
||
<converters:ColorToLightForgroundConverter x:Key="ColorToLightForgroundConverter" /> | ||
<converters:ColorToBlackWhiteConverter x:Key="ColorToBlackWhiteConverter" /> | ||
<converters:BrushToBlackWhiteConverter x:Key="BrushToBlackWhiteConverter" /> | ||
|
||
<Style x:Key="DefaultSfPickerStyle" TargetType="picker:SfPicker"> | ||
<Setter Property="ColumnDividerColor" Value="{DynamicResource PrimaryColor}" /> | ||
<Setter Property="Margin" Value="4,2"/> | ||
<Setter Property="Background" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" /> | ||
<!-- | ||
<Setter Property="HeaderView"> | ||
<Setter.Value> | ||
<picker:PickerHeaderView | ||
DividerColor="{DynamicResource PrimaryColor}" | ||
> | ||
</picker:PickerHeaderView> | ||
</Setter.Value> | ||
</Setter> | ||
--> | ||
<Setter Property="SelectionView"> | ||
<Setter.Value> | ||
<picker:PickerSelectionView | ||
CornerRadius="10" | ||
Padding="10, 5, 10, 5" | ||
Background="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray100}}" | ||
> | ||
</picker:PickerSelectionView> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="TextStyle"> | ||
<Setter.Value> | ||
<picker:PickerTextStyle | ||
FontSize="12" | ||
FontFamily="{StaticResource MontserratRegular}" | ||
TextColor="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray100}}" | ||
> | ||
</picker:PickerTextStyle> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="SelectedTextStyle"> | ||
<Setter.Value> | ||
<picker:PickerTextStyle | ||
FontSize="12" | ||
FontFamily="{StaticResource MontserratRegular}" | ||
TextColor="{Binding Source={RelativeSource AncestorType={x:Type picker:SfPicker}}, Path=Background, Converter={StaticResource BrushToBlackWhiteConverter}}" | ||
> | ||
</picker:PickerTextStyle> | ||
</Setter.Value> | ||
</Setter> | ||
<!-- | ||
<Setter Property="VisualStateManager.VisualStateGroups"> | ||
<VisualStateGroupList> | ||
<VisualStateGroup> | ||
<VisualState x:Name="Default"> | ||
<VisualState.Setters> | ||
</VisualState.Setters> | ||
</VisualState> | ||
<VisualState x:Name="Disabled"> | ||
<VisualState.Setters> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateGroupList> | ||
</Setter> | ||
--> | ||
</Style> | ||
<Style TargetType="picker:SfPicker" BasedOn="{StaticResource DefaultSfPickerStyle}"/> | ||
|
||
<Style x:Key="DefaultSfDateTimePickerStyle" TargetType="picker:SfDateTimePicker"> | ||
<Setter Property="ColumnDividerColor" Value="{DynamicResource PrimaryColor}" /> | ||
<Setter Property="Margin" Value="4,2"/> | ||
<Setter Property="Background" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" /> | ||
<Setter Property="TimeFormat" Value="HH_mm" /> | ||
<!-- | ||
<Setter Property="HeaderView"> | ||
<Setter.Value> | ||
<picker:DateTimePickerHeaderView | ||
DividerColor="{DynamicResource PrimaryColor}" | ||
TimeFormat="HH:mm" | ||
> | ||
<picker:DateTimePickerHeaderView.SelectionTextStyle> | ||
<picker:PickerTextStyle | ||
FontSize="12" | ||
FontFamily="{StaticResource MontserratRegular}" | ||
TextColor="{DynamicResource PrimaryColor}" | ||
/> | ||
</picker:DateTimePickerHeaderView.SelectionTextStyle> | ||
</picker:DateTimePickerHeaderView> | ||
</Setter.Value> | ||
</Setter> | ||
--> | ||
<Setter Property="SelectionView"> | ||
<Setter.Value> | ||
<picker:PickerSelectionView | ||
CornerRadius="10" | ||
Padding="10, 5, 10, 5" | ||
Background="{DynamicResource PrimaryColor}" | ||
> | ||
</picker:PickerSelectionView> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="TextStyle"> | ||
<Setter.Value> | ||
<picker:PickerTextStyle | ||
FontSize="12" | ||
FontFamily="{StaticResource MontserratRegular}" | ||
TextColor="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray100}}" | ||
> | ||
</picker:PickerTextStyle> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="SelectedTextStyle"> | ||
<Setter.Value> | ||
<picker:PickerTextStyle | ||
FontSize="12" | ||
FontFamily="{StaticResource MontserratRegular}" | ||
TextColor="{Binding Source={RelativeSource AncestorType={x:Type picker:SfDateTimePicker}}, Path=Background, Converter={StaticResource BrushToBlackWhiteConverter}}" | ||
> | ||
</picker:PickerTextStyle> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
<Style TargetType="picker:SfDateTimePicker" BasedOn="{StaticResource DefaultSfDateTimePickerStyle}"/> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters