Skip to content

Commit

Permalink
Display package tags
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Feb 19, 2024
1 parent 14130c4 commit 2a99bbc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/wingetui-interface/Interface/Pages/PackageDetailsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
xmlns:local="using:ModernWindow.Interface.Dialogs"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:widgets="using:ModernWindow.Interface.Widgets"
xmlns:xaml="using:Microsoft.UI.Xaml.Controls"
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
mc:Ignorable="d">

<Grid>
Expand All @@ -29,7 +31,18 @@

<!-- Tags + Description -->
<StackPanel Name="DescriptionPanel" Orientation="Vertical" VerticalAlignment="Top">
<GridView Name="TagGridView"/>
<xaml:ItemsRepeater Name="TagGridView" ItemsSource="{x:Bind ShowableTags}">
<xaml:ItemsRepeater.ItemTemplate>
<DataTemplate x:DataType="TextBlock">
<Border Background="{ThemeResource AccentAAFillColorDefaultBrush}" Padding="8,2,8,2" Margin="2" CornerRadius="12" Height="24" VerticalAlignment="Center" >
<TextBlock Text="{x:Bind Text}" Foreground="{ThemeResource TextOnAccentAAFillColorPrimary}"/>
</Border>
</DataTemplate>
</xaml:ItemsRepeater.ItemTemplate>
<xaml:ItemsRepeater.Layout>
<toolkit:WrapLayout x:Name="Wrap"/>
</xaml:ItemsRepeater.Layout>
</xaml:ItemsRepeater>
<TextBlock Name="DescriptionBox" TextWrapping="WrapWholeWords" Text="Hello World. This is the App's description"/>
</StackPanel>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using ModernWindow.PackageEngine.Operations;
using ModernWindow.Structures;
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
Expand All @@ -29,6 +30,7 @@ public sealed partial class PackageDetailsPage : Page
private PackageDetails Info;
OperationType FutureOperation;
bool PackageHasScreenshots = false;
public ObservableCollection<TextBlock> ShowableTags = new();

private enum LayoutMode
{
Expand Down Expand Up @@ -167,6 +169,10 @@ public async Task LoadInformation()
DownloadInstallerButton.IsEnabled = Info.InstallerUrl != null;
ReleaseNotesUrlButton.Content = Info.ReleaseNotesUrl != null ? Info.ReleaseNotesUrl : NotFound;
ReleaseNotesUrlButton.NavigateUri = Info.ReleaseNotesUrl != null ? Info.ReleaseNotesUrl : InvalidUri;

ShowableTags.Clear();
foreach (string tag in Info.Tags)
ShowableTags.Add(new TextBlock() { Text = tag });
}

public void ActionButton_Click(object sender, RoutedEventArgs e)
Expand Down
1 change: 1 addition & 0 deletions src/wingetui-interface/wingetui-interface.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Notifications" Version="7.1.2" />
Expand Down

0 comments on commit 2a99bbc

Please sign in to comment.