-
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.
add datatype to views that don't have direct VMs of their own
- Loading branch information
1 parent
af32c8d
commit 68d53a5
Showing
6 changed files
with
112 additions
and
53 deletions.
There are no files selected for viewing
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
90 changes: 58 additions & 32 deletions
90
Views/DataTemplates/ActivityFeedTournamentResultDataTemplate.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 |
---|---|---|
@@ -1,34 +1,60 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<DataTemplate xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" x:Class="Ifpa.Views.DataTemplates.ActivityFeedTournamentResultDataTemplate" xmlns:local="clr-namespace:Ifpa"> | ||
<StackLayout> | ||
<Grid Padding="10" ColumnDefinitions="35, *"> | ||
<Grid.Resources> | ||
<ResourceDictionary> | ||
<toolkit:InvertedBoolConverter x:Key="inverter" /> | ||
</ResourceDictionary> | ||
</Grid.Resources> | ||
<Image Grid.Column="0" Source="ribbon.png" HeightRequest="25" WidthRequest="25"> | ||
<Image.Behaviors> | ||
<toolkit:IconTintColorBehavior TintColor="{StaticResource IconAccentColor}" /> | ||
</Image.Behaviors> | ||
</Image> | ||
<StackLayout Grid.Column="1" HorizontalOptions="FillAndExpand" Padding="10,0,0,0"> | ||
<Label Text="{x:Static local:Strings.ActivityFeedTournamentResultDataTemplate_TournamentResultPosted}" FontAttributes="Bold" /> | ||
<Label FontSize="Small"> | ||
<Label.FormattedText> | ||
<FormattedString> | ||
<FormattedString.Spans> | ||
<Span Text="{x:Static local:Strings.ActivityFeedTournamentResultDataTemplate_TournamentResultsFor}" TextColor="{DynamicResource SecondaryTextColor}" /> | ||
<Span Text="{Binding Description, Mode=OneWay}" /> | ||
<Span Text="{x:Static local:Strings.ActivityFeedTournamentResultDataTemplate_WerePostedToYourProfile}" TextColor="{DynamicResource SecondaryTextColor}" /> | ||
</FormattedString.Spans> | ||
</FormattedString> | ||
</Label.FormattedText> | ||
</Label> | ||
<Label LineBreakMode="NoWrap" FontSize="Micro" Text="{Binding CreatedDateTime, StringFormat='{0:d}'}" TextColor="{DynamicResource SecondaryTextColor}" /> | ||
</StackLayout> | ||
<BoxView Color="{StaticResource IconAccentColor}" Grid.ColumnSpan="2" Margin="10,0,0,0" IsVisible="{Binding HasBeenSeen, Mode=OneWay, Converter={StaticResource inverter}}" CornerRadius="6" WidthRequest="12" HeightRequest="12" VerticalOptions="Center" HorizontalOptions="End" /> | ||
</Grid> | ||
<BoxView Style="{StaticResource BoxSeperator}" /> | ||
</StackLayout> | ||
<DataTemplate xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" | ||
x:Class="Ifpa.Views.DataTemplates.ActivityFeedTournamentResultDataTemplate" | ||
xmlns:local="clr-namespace:Ifpa" | ||
xmlns:models="clr-namespace:Ifpa.Models" | ||
x:DataType="models:ActivityFeedItem"> | ||
<StackLayout> | ||
<Grid Padding="10" | ||
ColumnDefinitions="35, *"> | ||
<Grid.Resources> | ||
<ResourceDictionary> | ||
<toolkit:InvertedBoolConverter x:Key="inverter" /> | ||
</ResourceDictionary> | ||
</Grid.Resources> | ||
<Image Grid.Column="0" | ||
Source="ribbon.png" | ||
HeightRequest="25" | ||
WidthRequest="25"> | ||
<Image.Behaviors> | ||
<toolkit:IconTintColorBehavior TintColor="{StaticResource IconAccentColor}" /> | ||
</Image.Behaviors> | ||
</Image> | ||
<StackLayout Grid.Column="1" | ||
HorizontalOptions="FillAndExpand" | ||
Padding="10,0,0,0"> | ||
<Label Text="{x:Static local:Strings.ActivityFeedTournamentResultDataTemplate_TournamentResultPosted}" | ||
FontAttributes="Bold" /> | ||
<Label FontSize="Small"> | ||
<Label.FormattedText> | ||
<FormattedString> | ||
<FormattedString.Spans> | ||
<Span Text="{x:Static local:Strings.ActivityFeedTournamentResultDataTemplate_TournamentResultsFor}" | ||
TextColor="{DynamicResource SecondaryTextColor}" /> | ||
<Span Text="{Binding Description, Mode=OneWay}" /> | ||
<Span Text="{x:Static local:Strings.ActivityFeedTournamentResultDataTemplate_WerePostedToYourProfile}" | ||
TextColor="{DynamicResource SecondaryTextColor}" /> | ||
</FormattedString.Spans> | ||
</FormattedString> | ||
</Label.FormattedText> | ||
</Label> | ||
<Label LineBreakMode="NoWrap" | ||
FontSize="Micro" | ||
Text="{Binding CreatedDateTime, StringFormat='{0:d}'}" | ||
TextColor="{DynamicResource SecondaryTextColor}" /> | ||
</StackLayout> | ||
<BoxView Color="{StaticResource IconAccentColor}" | ||
Grid.ColumnSpan="2" | ||
Margin="10,0,0,0" | ||
IsVisible="{Binding HasBeenSeen, Mode=OneWay, Converter={StaticResource inverter}}" | ||
CornerRadius="6" | ||
WidthRequest="12" | ||
HeightRequest="12" | ||
VerticalOptions="Center" | ||
HorizontalOptions="End" /> | ||
</Grid> | ||
<BoxView Style="{StaticResource BoxSeperator}" /> | ||
</StackLayout> | ||
</DataTemplate> |
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 |
---|---|---|
@@ -1,20 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<DataTemplate xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:Ifpa.Converters" x:Class="Ifpa.Views.DataTemplates.PlayerResultDataTemplate"> | ||
<VerticalStackLayout> | ||
<VerticalStackLayout Padding="15,10"> | ||
<VerticalStackLayout.Resources> | ||
<local:IntToOrdinalStringConverter x:Key="intToOrdinalString" /> | ||
</VerticalStackLayout.Resources> | ||
<Grid ColumnDefinitions="*,100"> | ||
<Label Grid.Column="0" Text="{Binding TournamentName}" FontSize="16" HorizontalTextAlignment="Start" /> | ||
<Label Grid.Column="1" LineBreakMode="NoWrap" HorizontalTextAlignment="End" MinimumHeightRequest="40" Text="{Binding Position, Converter={StaticResource intToOrdinalString}}" FontSize="24" /> | ||
</Grid> | ||
<Grid ColumnDefinitions="*,*,*"> | ||
<Label Grid.Column="0" LineBreakMode="NoWrap" HorizontalTextAlignment="Start" FontSize="12" Text="{Binding EventName}" TextColor="{DynamicResource SecondaryTextColor}" /> | ||
<Label Grid.Column="1" Text="{Binding EventDate, StringFormat='{0:d}'}" FontSize="12" TextColor="{DynamicResource SecondaryTextColor}" HorizontalTextAlignment="Center" /> | ||
<Label Grid.Column="2" LineBreakMode="NoWrap" HorizontalTextAlignment="End" FontSize="12" Text="{Binding CurrentPoints, StringFormat='{0:0.00}'}" TextColor="{DynamicResource SecondaryTextColor}" /> | ||
</Grid> | ||
<DataTemplate xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:local="clr-namespace:Ifpa.Converters" | ||
x:Class="Ifpa.Views.DataTemplates.PlayerResultDataTemplate" | ||
xmlns:ifpaplayer="clr-namespace:PinballApi.Models.WPPR.v2.Players;assembly=PinballApi" | ||
x:DataType="ifpaplayer:PlayerResult"> | ||
<VerticalStackLayout> | ||
<VerticalStackLayout Padding="15,10"> | ||
<VerticalStackLayout.Resources> | ||
<local:IntToOrdinalStringConverter x:Key="intToOrdinalString" /> | ||
</VerticalStackLayout.Resources> | ||
<Grid ColumnDefinitions="*,100"> | ||
<Label Grid.Column="0" | ||
Text="{Binding TournamentName}" | ||
FontSize="16" | ||
HorizontalTextAlignment="Start" /> | ||
<Label Grid.Column="1" | ||
LineBreakMode="NoWrap" | ||
HorizontalTextAlignment="End" | ||
MinimumHeightRequest="40" | ||
Text="{Binding Position, Converter={StaticResource intToOrdinalString}}" | ||
FontSize="24" /> | ||
</Grid> | ||
<Grid ColumnDefinitions="*,*,*"> | ||
<Label Grid.Column="0" | ||
LineBreakMode="NoWrap" | ||
HorizontalTextAlignment="Start" | ||
FontSize="12" | ||
Text="{Binding EventName}" | ||
TextColor="{DynamicResource SecondaryTextColor}" /> | ||
<Label Grid.Column="1" | ||
Text="{Binding EventDate, StringFormat='{0:d}'}" | ||
FontSize="12" | ||
TextColor="{DynamicResource SecondaryTextColor}" | ||
HorizontalTextAlignment="Center" /> | ||
<Label Grid.Column="2" | ||
LineBreakMode="NoWrap" | ||
HorizontalTextAlignment="End" | ||
FontSize="12" | ||
Text="{Binding CurrentPoints, StringFormat='{0:0.00}'}" | ||
TextColor="{DynamicResource SecondaryTextColor}" /> | ||
</Grid> | ||
</VerticalStackLayout> | ||
<BoxView Style="{StaticResource BoxSeperator}" /> | ||
</VerticalStackLayout> | ||
<BoxView Style="{StaticResource BoxSeperator}" /> | ||
</VerticalStackLayout> | ||
</DataTemplate> |
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