Skip to content

Commit

Permalink
Merge pull request #414 from AndreasReitberger/413-update-namings-of-…
Browse files Browse the repository at this point in the history
…itemtemplates-and-other-static-resources

Renamed `DataTemplates`
  • Loading branch information
AndreasReitberger authored Jan 7, 2024
2 parents 77b7d84 + fe2a389 commit e9d4ba6
Show file tree
Hide file tree
Showing 10 changed files with 181 additions and 388 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<shared:Colors />
<ResourceDictionary Source="/Resources/Themes/ItemTemplates/ListViewSwipeTemplates.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="controls:EnhancedListView">

<Style x:Key="Style.Syncfusion.EnhancedListView.Default" TargetType="controls:EnhancedListView">
<Setter Property="SelectionBackground" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray800}}" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False" TargetType="controls:EnhancedListView">
Expand All @@ -22,28 +22,30 @@
</Style.Triggers>
</Style>

<Style x:Key="DeleteGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" >
<Style TargetType="controls:EnhancedListView" BasedOn="{StaticResource Style.Syncfusion.EnhancedListView.Default}"/>

<Style x:Key="Style.Syncfusion.EnhancedListView.DeleteGestureSwipe" TargetType="controls:EnhancedListView" >
<Setter Property="AllowSwiping" Value="True" />
<Setter Property="SwipeThreshold" Value="70" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource DeleteGestureSwipeTemplate}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.Delete}" />
</Style>

<Style x:Key="DeleteEditGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" BasedOn="{StaticResource DeleteGestureSwipeEnhancedListViewStyle}">
<Setter Property="StartSwipeTemplate" Value="{StaticResource DeleteGestureSwipeTemplate}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource EditDeleteGestureSwipeTemplate}" />
<Style x:Key="DeleteEditGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" BasedOn="{StaticResource Style.Syncfusion.EnhancedListView.DeleteGestureSwipe}">
<Setter Property="StartSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.Delete}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.EditDelete}" />
</Style>

<Style x:Key="PrintDeleteViewGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" BasedOn="{StaticResource DeleteGestureSwipeEnhancedListViewStyle}">
<Setter Property="StartSwipeTemplate" Value="{StaticResource PrintGestureSwipeTemplate}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource ViewDeleteGestureSwipeTemplate}" />
<Style x:Key="PrintDeleteViewGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" BasedOn="{StaticResource Style.Syncfusion.EnhancedListView.DeleteGestureSwipe}">
<Setter Property="StartSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.Print3d}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.ViewDelete}" />
</Style>

<Style x:Key="DeleteViewPrintGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" BasedOn="{StaticResource DeleteGestureSwipeEnhancedListViewStyle}">
<Setter Property="StartSwipeTemplate" Value="{StaticResource DeleteGestureSwipeTemplate}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource PrintViewGestureSwipeTemplate}" />
<Style x:Key="DeleteViewPrintGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" BasedOn="{StaticResource Style.Syncfusion.EnhancedListView.DeleteGestureSwipe}">
<Setter Property="StartSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.Delete}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.Print3dView }" />
</Style>
<Style x:Key="DeleteEditExecuteGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" BasedOn="{StaticResource DeleteGestureSwipeEnhancedListViewStyle}">
<Setter Property="StartSwipeTemplate" Value="{StaticResource DeleteGestureSwipeTemplate}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource ExecuteEditGestureSwipeTemplate}" />
<Style x:Key="DeleteEditExecuteGestureSwipeEnhancedListViewStyle" TargetType="controls:EnhancedListView" BasedOn="{StaticResource Style.Syncfusion.EnhancedListView.DeleteGestureSwipe}">
<Setter Property="StartSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.Delete}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.ExecuteEdit}" />
</Style>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<Style x:Key="Style.Syncfusion.SfListView.Swipe.DeleteEdit" TargetType="listView:SfListView" BasedOn="{StaticResource Style.Syncfusion.SfListView.Default}">
<Setter Property="AllowSwiping" Value="True" />
<Setter Property="SwipeThreshold" Value="70" />
<Setter Property="StartSwipeTemplate" Value="{StaticResource DeleteGestureSwipeTemplate}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource EditGestureSwipeTemplate}" />
<Setter Property="StartSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.Delete}" />
<Setter Property="EndSwipeTemplate" Value="{StaticResource DataTemplate.Syncfusion.Swipe.Edit}" />
</Style>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
>
<converters:UriToStringConverter x:Key="UriToStringConverter" />

<DataTemplate x:Key="GroupHeaderSyncfusionTemplate">
<DataTemplate x:Key="DataTemplate.Syncfusion.Header.Group">
<ViewCell>
<StackLayout
Style="{StaticResource Style.Core.StackLayout.Header}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>
<converters:UriToStringConverter x:Key="UriToStringConverter" />

<DataTemplate x:Key="ProFeatureItemTemplate" x:DataType="documentation:ProVersionFeature">
<DataTemplate x:Key="DataTemplate.Syncfusion.ProVersionFeature.Default" x:DataType="documentation:ProVersionFeature">
<ViewCell>
<Grid
Padding="8,6"
Expand Down Expand Up @@ -48,204 +48,4 @@
</Grid>
</ViewCell>
</DataTemplate>

<DataTemplate x:Key="AppEventTemplate" x:DataType="eventLogger:AppEvent">
<ViewCell>
<Grid
x:Name="Grid"
Padding="16,12"
ColumnSpacing="16"
RowSpacing="2"
RowDefinitions="Auto"
ColumnDefinitions="48,*"
>
<!-- Icon -->
<Label
Margin="3.5,0,0,0"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
>
<Label.Style>
<Style TargetType="Label" BasedOn="{StaticResource Style.Core.Label.Icon}">
<Setter Property="Text" Value="{x:Static icons:MaterialIcons.AlertCircleOutline}"/>
<Style.Triggers>
<!-- Info -->
<DataTrigger TargetType="Label" Binding="{Binding Level}" Value="Info">
<Setter Property="Text" Value="{x:Static icons:MaterialIcons.InformationOutline}"/>
<Setter Property="TextColor" Value="{StaticResource Blue}"/>
</DataTrigger>
<!-- Alert -->
<DataTrigger TargetType="Label" Binding="{Binding Level}" Value="Warning">
<Setter Property="Text" Value="{x:Static icons:MaterialIcons.AlertCircleOutline}"/>
<Setter Property="TextColor" Value="{StaticResource Yellow}"/>
</DataTrigger>
<!-- Error -->
<DataTrigger TargetType="Label" Binding="{Binding Level}" Value="Critical">
<Setter Property="Text" Value="{x:Static icons:MaterialIcons.CloseCircleOutline}"/>
<Setter Property="TextColor" Value="{StaticResource Red}"/>
</DataTrigger>
<!-- Performance -->
<DataTrigger TargetType="Label" Binding="{Binding Level}" Value="Performance">
<Setter Property="Text" Value="{x:Static icons:MaterialIcons.Speedometer}"/>
<Setter Property="TextColor" Value="{StaticResource LightGreen}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
<!-- Quick Infos -->
<StackLayout
Grid.Column="1"
Spacing="1"
CompressedLayout.IsHeadless="true"
>
<Label
LineBreakMode="WordWrap"
Style="{StaticResource Style.Core.Label.Default}"
Text="{Binding Message}"
FontAttributes="Bold"
VerticalTextAlignment="Center"
/>
<Label
LineBreakMode="WordWrap"
Text="{Binding Args}"
VerticalTextAlignment="Center"
>
<Label.Style>
<Style TargetType="Label" BasedOn="{StaticResource Style.Core.Label.Small}">
<Setter Property="IsVisible" Value="True"/>
<Style.Triggers>
<!-- Has no args -->
<DataTrigger TargetType="Label" Binding="{Binding Args}" Value="{x:Null}">
<Setter Property="IsVisible" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>

<!-- Localization -->
<DataTemplate x:Key="LanguageItemTemplate" x:DataType="language:LocalizationInfo">
<ViewCell>
<Grid
Padding="2"
Margin="1"
ColumnDefinitions="48,*"
>
<Grid.RowDefinitions>
<RowDefinition Height="{OnIdiom Tablet=80, Default=60}" />
</Grid.RowDefinitions>
<!-- Flag -->
<Image
HeightRequest="24"
Source="{Binding FlagUri, Converter={StaticResource UriToStringConverter}}"
/>

<!-- Infos -->
<StackLayout
Grid.Column="1"
Spacing="1"
Padding="2,5,-10,0"
CompressedLayout.IsHeadless="true"
>
<!-- Language name -->
<Label
LineBreakMode="NoWrap"
Style="{StaticResource Style.Core.Label.Primary}"
Text="{Binding Name}"
/>
<!-- Translator -->
<Label
Style="{StaticResource Style.Core.Label.Default}"
LineBreakMode="WordWrap"
Text="{Binding Translator}"
FontSize="12"
/>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>

<DataTemplate x:Key="LanguageSelectedItemTemplate" x:DataType="language:LocalizationInfo">
<ViewCell>
<Grid
Padding="2"
Margin="1"
Background="{DynamicResource PrimaryColor}"
ColumnDefinitions="48,*"
>
<Grid.RowDefinitions>
<RowDefinition Height="{OnIdiom Tablet=80, Default=60}" />
</Grid.RowDefinitions>

<!-- Flag -->
<Image
HeightRequest="24"
Source="{Binding FlagUri, Converter={StaticResource UriToStringConverter}}"
/>

<!-- Infos -->
<StackLayout
Grid.Column="1"
Spacing="1"
Padding="2,5,-10,0"
CompressedLayout.IsHeadless="true"
>
<!-- Language name -->
<Label
LineBreakMode="NoWrap"
Style="{StaticResource Style.Core.Label.Primary}"
TextColor="{StaticResource White}"
Text="{Binding Name}"
/>
<!-- Translator -->
<Label
Style="{StaticResource Style.Core.Label.Default}"
LineBreakMode="WordWrap"
Text="{Binding Translator}"
TextColor="{StaticResource White}"
FontSize="12"
/>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>

<!-- Documentation -->
<DataTemplate x:Key="ChangelogItemTemplate" x:DataType="documentation:ChangelogInfo">
<ViewCell>
<Grid
x:Name="Grid"
Padding="16,12"
ColumnSpacing="16"
RowSpacing="2"
ColumnDefinitions="*,Auto"
>
<Label
Style="{StaticResource Style.Core.Label.Default}"
LineBreakMode="WordWrap"
Text="{Binding Changelog}"
/>
<Border
Background="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray800}}"
Style="{StaticResource Style.Core.Border.Profile}"
Grid.Column="1"
VerticalOptions="Center"
>
<Label
Margin="4"
Style="{StaticResource Style.Core.Label.Icon.MaterialDesign}"
Text="{Binding Type, Converter={StaticResource StringToChangelogIconConverter}}"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
/>
</Border>
</Grid>
</ViewCell>
</DataTemplate>

</ResourceDictionary>
Loading

0 comments on commit e9d4ba6

Please sign in to comment.