Skip to content

Commit 5df6e9c

Browse files
committed
chore: Update GalleryImageModel Naming
1 parent 22db6b8 commit 5df6e9c

File tree

14 files changed

+148
-143
lines changed

14 files changed

+148
-143
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
2+
<PropertyGroup>
3+
<TargetFramework>net9.0</TargetFramework>
44
<OutputType>Library</OutputType>
5-
<GenerateLibraryLayout>true</GenerateLibraryLayout>
6-
</PropertyGroup>
5+
<GenerateLibraryLayout>true</GenerateLibraryLayout>
6+
</PropertyGroup>
77
<PropertyGroup>
88
<AssemblyName>DevTKSS.Extensions.Uno</AssemblyName>
99
<RootNamespace>DevTKSS.Extensions.Uno</RootNamespace>
1010
<Description>Extensions that are extending Uno Platform functionallities</Description>
1111
</PropertyGroup>
1212
<ItemGroup>
13-
<PackageReference Include="Uno.Core.Extensions" />
13+
<PackageReference Include="Uno.Core.Extensions" />
1414
<PackageReference Include="Uno.Extensions.Storage" />
1515
</ItemGroup>
1616
</Project>

src/DevTKSS.Uno.MvuxListApp/Presentation/MainModel.cs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,30 @@ private async void Main_OnRouteChanged(object? sender, RouteChangedEventArgs e)
3939
}
4040

4141
public IListState<string> DashboardList => ListState<string>.Async(this,GetMembersAsync)
42-
.Selection(SelectedMember);
42+
.Selection(SelectedMember);
4343

4444
public IState<string> SelectedMember => State<string>.Value(this,() => string.Empty);
4545

46-
public IState<string> ModifiedMemberName => State<string>.Empty(this)
47-
.ForEach(RenameMemberAsync);
48-
49-
public async ValueTask RenameMemberAsync([FeedParameter(nameof(ModifiedMemberName))]string? modifiedName, CancellationToken ct)
46+
public IState<string> ModifiedMemberName => State<string>.Empty(this);
47+
//.ForEach(RenameMemberAsync);
48+
49+
public async ValueTask RenameMemberAsync(
50+
[FeedParameter(nameof(ModifiedMemberName))]string? modName,
51+
[FeedParameter(nameof(SelectedMember))]string? replaceMember,
52+
CancellationToken ct)
5053
{
51-
52-
string replaceMeItem = await SelectedMember ?? string.Empty;
53-
string modifiedItem = await ModifiedMemberName ?? string.Empty;
54-
_logger.LogInformation("Modified MemberName ist: {modifiedItem}", modifiedItem);
55-
_logger.LogInformation("SelectedMemeber ist: {selectedMember}", replaceMeItem);
5654

57-
await DashboardList.RemoveAllAsync(item => item == replaceMeItem);
55+
_logger.LogInformation("Modified MemberName ist: {modifiedName}", modName);
56+
_logger.LogInformation("SelectedMember ist: {selectedMember}", replaceMember);
57+
if (string.IsNullOrWhiteSpace(modName))
58+
return;
5859

59-
await DashboardList.AddAsync(modifiedItem,ct);
60+
await DashboardList.UpdateAllAsync(
61+
match: item => item == replaceMember,
62+
updater: _ => modName,
63+
ct: ct
64+
);
6065

61-
await DashboardList.TrySelectAsync(modifiedItem,ct);
66+
await DashboardList.TrySelectAsync(modName, ct);
6267
}
6368
}

src/DevTKSS.Uno.MvuxListApp/Presentation/MainPage.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
<TextBlock Grid.Row="1"
2424
HorizontalAlignment="Center"
2525
TextAlignment="Center"
26-
Text="{Binding SelectedMember}" />
26+
Text="{Binding Path=SelectedMember,Mode=OneWay}" />
2727

2828
<ListView HorizontalAlignment="Center" MinWidth="200" Grid.Row="2"
2929
ItemsSource="{Binding DashboardList}" />
3030

31-
<TextBox PlaceholderText="Ändere hier den Namen des Mitglieds:"
32-
Text="{Binding ModifyedMemberName, Mode=TwoWay}"/>
33-
<Button Content="Ändere Namen"
31+
<TextBox PlaceholderText="Change the Name of the selected Member:"
32+
Text="{Binding ModifiedMemberName, Mode=TwoWay}"/>
33+
<Button Content="Change Name"
3434
Command="{Binding Path=RenameMemberAsync}" />
3535
</StackPanel>
3636
</Grid>

src/DevTKSS.Uno.Samples.MvuxGallery/Assets/Samples/Card-GalleryImage.DataTemplate.xaml.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ xmlns:gm="using:DevTKSS.Uno.Samples.MvuxGallery.Models.GalleryImages"
33

44
...
55

6-
<DataTemplate x:Key="StyledCardTemplate" x:DataType="gm:GalleryImageModel">
6+
<DataTemplate x:Key="StyledCardTemplate" x:DataType="gm:GalleryImage">
77
<utu:Card CornerRadius="20"
88
HorizontalContentAlignment="Stretch"
99
HeaderContent="{Binding Title}"
@@ -17,7 +17,7 @@ xmlns:gm="using:DevTKSS.Uno.Samples.MvuxGallery.Models.GalleryImages"
1717
MediaContentTemplate="{StaticResource CardMediaContentTemplate}"/>
1818
</DataTemplate>
1919

20-
<DataTemplate x:DataType="gm:GalleryImageModel" x:Key="CardHeaderContentTemplate">
20+
<DataTemplate x:DataType="gm:GalleryImage" x:Key="CardHeaderContentTemplate">
2121
<Border Background="{ThemeResource SurfaceInverseBrush}" Opacity=".7">
2222
<TextBlock Text="{Binding }"
2323
Style="{ThemeResource TitleLarge}"
@@ -27,7 +27,7 @@ xmlns:gm="using:DevTKSS.Uno.Samples.MvuxGallery.Models.GalleryImages"
2727
</Border>
2828
</DataTemplate>
2929

30-
<DataTemplate x:DataType="gm:GalleryImageModel" x:Key="CardSubHeaderContentTemplate">
30+
<DataTemplate x:DataType="gm:GalleryImage" x:Key="CardSubHeaderContentTemplate">
3131
<Border Background="{ThemeResource SurfaceInverseBrush}" Opacity=".7">
3232
<TextBlock Text="{Binding }"
3333
Style="{ThemeResource BodySmall}"
@@ -37,7 +37,7 @@ xmlns:gm="using:DevTKSS.Uno.Samples.MvuxGallery.Models.GalleryImages"
3737
</Border>
3838
</DataTemplate>
3939

40-
<DataTemplate x:Key="CardMediaContentTemplate" x:DataType="gm:GalleryImageModel">
40+
<DataTemplate x:Key="CardMediaContentTemplate" x:DataType="gm:GalleryImage">
4141
<Image Source="{Binding }"
4242
Stretch="Uniform"
4343
Width="{utu:AncestorBinding AncestorType=utu:Card, Path=Width}" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
namespace DevTKSS.Uno.Samples.MvuxGallery.Models.GalleryImages;
22

3-
public partial record GalleryImageModel(string Title, string ImageLocation, string Description);
3+
public partial record GalleryImage(string Title, string ImageLocation, string Description);

src/DevTKSS.Uno.Samples.MvuxGallery/Assets/Samples/GalleryImageService-noResw.cs.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public partial class GalleryImageService : IGalleryImageService
1212
this._localizationService = localizationService;
1313
}
1414

15-
public async ValueTask<IImmutableList<GalleryImageModel>> GetGalleryImagesWithoutReswAsync(CancellationToken ct)
15+
public async ValueTask<IImmutableList<GalleryImage>> GetGalleryImagesWithoutReswAsync(CancellationToken ct)
1616
{
1717
string cultureString = _localizationService.CurrentCulture.TwoLetterISOLanguageName;
1818
var galleryImages = cultureString switch
@@ -29,33 +29,33 @@ public partial class GalleryImageService : IGalleryImageService
2929

3030
#region German gallery descriptions
3131

32-
private async ValueTask<IImmutableList<GalleryImageModel>> GetDEGalleryImagesAsync(CancellationToken ct)
32+
private async ValueTask<IImmutableList<GalleryImage>> GetDEGalleryImagesAsync(CancellationToken ct)
3333
{
3434
// Simulate a delay to mimic an async operation (e.g., fetching from a database or API)
3535
await Task.Delay(TimeSpan.FromSeconds(2),ct);
36-
var galleryImages = new GalleryImageModel[]
36+
var galleryImages = new GalleryImage[]
3737
{
38-
new GalleryImageModel(
38+
new GalleryImage(
3939
Title: "Fluffy",
4040
ImageLocation: "ms-appx:///Assets/Images/img_20240531_141928.jpg",
4141
Description: "Ein kleiner Kuschelmeister, der es liebt, im Zentrum der aufmerksamkeit zu stehen und sanft gekrault zu werden."),
42-
new GalleryImageModel(
42+
new GalleryImage(
4343
Title: "Snowball",
4444
ImageLocation: "ms-appx:///Assets/Images/img_20230302_175758.jpg",
4545
Description: "Ein verspielter Wirbelwind, der mit seinen Hüpfern jeden Raum zum Leben erweckt und dabei immer ein Lächeln hervorruft."),
46-
new GalleryImageModel(
46+
new GalleryImage(
4747
Title: "Buddy",
4848
ImageLocation: "ms-appx:///Assets/Images/img_20240602_130506.jpg",
4949
Description: "Ein neugieriger Abenteurer, der ständig mit tapsigen Pfoten und seinem aufgeweckten Näschen die Welt erkundet."),
50-
new GalleryImageModel(
50+
new GalleryImage(
5151
Title: "Coco",
5252
ImageLocation: "ms-appx:///Assets/Images/img_20240721_130401.jpg",
5353
Description: "Ein kleiner Genießer, der sich nichts sehnlicher wünscht, als den ganzen Tag an frischem Grünzeug zu knabbern."),
54-
new GalleryImageModel(
54+
new GalleryImage(
5555
Title: "Bunny",
5656
ImageLocation: "ms-appx:///Assets/Images/img_20240721_130831.jpg",
5757
Description: "Ein absoluter Herzensbrecher, der sich mit einem einzigen Blick tief in die Herzen seiner Menschen schleicht."),
58-
new GalleryImageModel(
58+
new GalleryImage(
5959
Title: "Thumper",
6060
ImageLocation: "ms-appx:///Assets/Images/img_20240721_132103.jpg",
6161
Description: "Ein lebhafter Freigeist, der mit seinen lustigen Sprüngen und Hüpfern für pure Lebensfreude sorgt."),
@@ -67,33 +67,33 @@ public partial class GalleryImageService : IGalleryImageService
6767

6868
#region English gallery descriptions
6969

70-
private async ValueTask<IImmutableList<GalleryImageModel>> GetENGalleryImagesAsync(CancellationToken ct)
70+
private async ValueTask<IImmutableList<GalleryImage>> GetENGalleryImagesAsync(CancellationToken ct)
7171
{
7272
// Simulate a delay to mimic an async operation (e.g., fetching from a database or API)
7373
await Task.Delay(TimeSpan.FromSeconds(2), ct);
74-
var galleryImages = new GalleryImageModel[]
74+
var galleryImages = new GalleryImage[]
7575
{
76-
new GalleryImageModel(
76+
new GalleryImage(
7777
Title: "Fluffy",
7878
ImageLocation: "ms-appx:///Assets/Images/img_20240531_141928.jpg",
7979
Description: "A little snuggle expert who loves curling up in blankets and soaking up gentle attention."),
80-
new GalleryImageModel(
80+
new GalleryImage(
8181
Title: "Snowball",
8282
ImageLocation: "ms-appx:///Assets/Images/img_20230302_175758.jpg",
8383
Description: "A playful bundle of energy who hops around spreading joy wherever they go."),
84-
new GalleryImageModel(
84+
new GalleryImage(
8585
Title: "Buddy",
8686
ImageLocation: "ms-appx:///Assets/Images/img_20240602_130506.jpg",
8787
Description: "A curious explorer, always investigating the world with tiny paws and an inquisitive nose."),
88-
new GalleryImageModel(
88+
new GalleryImage(
8989
Title: "Coco",
9090
ImageLocation: "ms-appx:///Assets/Images/img_20240721_130401.jpg",
9191
Description: "A little foodie who would happily spend all day nibbling on fresh treats."),
92-
new GalleryImageModel(
92+
new GalleryImage(
9393
Title: "Bunny",
9494
ImageLocation: "ms-appx:///Assets/Images/img_20240721_130831.jpg",
9595
Description: "A charming sweetheart who wins hearts with just one adorable glance."),
96-
new GalleryImageModel(
96+
new GalleryImage(
9797
Title: "Thumper",
9898
ImageLocation: "ms-appx:///Assets/Images/img_20240721_132103.jpg",
9999
Description: "A lively free spirit who bounces around spreading cheer and fun."),

src/DevTKSS.Uno.Samples.MvuxGallery/Assets/Samples/GalleryImageService-resw.cs.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ public partial class GalleryImageService : IGalleryImageService
1313
this._stringlocalizer = _stringLocalizer;
1414
}
1515

16-
public async ValueTask<IImmutableList<GalleryImageModel>> GetGalleryImagesWithReswAsync(CancellationToken ct)
16+
public async ValueTask<IImmutableList<GalleryImage>> GetGalleryImagesWithReswAsync(CancellationToken ct)
1717
{
1818
return await GetGalleryImagesAsync(ct);
1919
}
20-
public async ValueTask<IImmutableList<GalleryImageModel>> GetGalleryImagesWithoutReswAsync(CancellationToken ct)
20+
public async ValueTask<IImmutableList<GalleryImage>> GetGalleryImagesWithoutReswAsync(CancellationToken ct)
2121
{
2222
string cultureString = _localizationService.CurrentCulture.TwoLetterISOLanguageName;
2323
var galleryImages = cultureString switch
@@ -32,33 +32,33 @@ public partial class GalleryImageService : IGalleryImageService
3232

3333
#region Get culture specific gallery imageDescription
3434

35-
private async ValueTask<IImmutableList<GalleryImageModel>> GetGalleryImagesAsync(CancellationToken ct)
35+
private async ValueTask<IImmutableList<GalleryImage>> GetGalleryImagesAsync(CancellationToken ct)
3636
{
3737
// Simulate a delay to mimic data fetching
3838
await Task.Delay(TimeSpan.FromSeconds(2), ct);
39-
var galleryImages = new GalleryImageModel[]
39+
var galleryImages = new GalleryImage[]
4040
{
41-
new GalleryImageModel(
41+
new GalleryImage(
4242
Title: "Fluffy",
4343
ImageLocation: "ms-appx:///Assets/Images/img_20240531_141928.jpg",
4444
Description: _stringlocalizer["img_20240531_141928"]),
45-
new GalleryImageModel(
45+
new GalleryImage(
4646
Title: "Snowball",
4747
ImageLocation: "ms-appx:///Assets/Images/img_20230302_175758.jpg",
4848
Description: _stringlocalizer["img_20230302_175758"]),
49-
new GalleryImageModel(
49+
new GalleryImage(
5050
Title: "Buddy",
5151
ImageLocation: "ms-appx:///Assets/Images/img_20240602_130506.jpg",
5252
Description: _stringlocalizer["img_20240602_130506"]),
53-
new GalleryImageModel(
53+
new GalleryImage(
5454
Title: "Coco",
5555
ImageLocation: "ms-appx:///Assets/Images/img_20240721_130401.jpg",
5656
Description: _stringlocalizer["img_20240721_130401"]),
57-
new GalleryImageModel(
57+
new GalleryImage(
5858
Title: "Bunny",
5959
ImageLocation: "ms-appx:///Assets/Images/img_20240721_130831.jpg",
6060
Description: _stringlocalizer["img_20240721_130831"]),
61-
new GalleryImageModel(
61+
new GalleryImage(
6262
Title: "Thumper",
6363
ImageLocation: "ms-appx:///Assets/Images/img_20240721_132103.jpg",
6464
Description: _stringlocalizer["img_20240721_132103"]),
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
<Project Sdk="Uno.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net9.0-desktop;net9.0</TargetFrameworks> <!--;net9.0-windows10.0.26100-->
4-
<!-- BUG: Windows target unable to build when using ResourcesDictionary imported in App.xaml see https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/issues/15 for more information-->
5-
<!-- <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>-->
6-
<OutputType>Exe</OutputType>
7-
<UnoSingleProject>true</UnoSingleProject>
2+
<PropertyGroup>
3+
<TargetFrameworks>net9.0-desktop;net9.0</TargetFrameworks> <!--;net9.0-windows10.0.26100-->
4+
<!-- BUG: Windows target unable to build when using ResourcesDictionary imported in App.xaml see https://github.com/DevTKSS/DevTKSS.Uno.SampleApps/issues/15 for more information-->
5+
<!-- <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>-->
6+
<OutputType>Exe</OutputType>
7+
<UnoSingleProject>true</UnoSingleProject>
88

9-
<!-- Display name -->
10-
<ApplicationTitle>DevTKSS MvuxGallery</ApplicationTitle>
11-
<!-- App Identifier -->
12-
<ApplicationId>com.companyname.DevTKSS.Uno.Samples.MvuxGallery</ApplicationId>
13-
<!-- Versions -->
14-
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
15-
<ApplicationVersion>1</ApplicationVersion>
16-
<!-- Package Publisher -->
17-
<ApplicationPublisher>TKSSonja</ApplicationPublisher>
18-
<!-- Package Description -->
19-
<Description>DevTKSS MvuxGallery powered by Uno Platform.</Description>
20-
<!--
21-
If you encounter this error message:
9+
<!-- Display name -->
10+
<ApplicationTitle>DevTKSS MvuxGallery</ApplicationTitle>
11+
<!-- App Identifier -->
12+
<ApplicationId>com.companyname.DevTKSS.Uno.Samples.MvuxGallery</ApplicationId>
13+
<!-- Versions -->
14+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
15+
<ApplicationVersion>1</ApplicationVersion>
16+
<!-- Package Publisher -->
17+
<ApplicationPublisher>TKSSonja</ApplicationPublisher>
18+
<!-- Package Description -->
19+
<Description>DevTKSS MvuxGallery powered by Uno Platform.</Description>
20+
<!--
21+
If you encounter this error message:
2222
23-
error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll.
24-
Please update to a newer .NET SDK in order to reference this assembly.
23+
error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll.
24+
Please update to a newer .NET SDK in order to reference this assembly.
2525
26-
This means that the two packages below must be aligned with the "build" version number of
27-
the "Microsoft.Windows.SDK.BuildTools" package above, and the "revision" version number
28-
must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref.
29-
-->
30-
<!-- <WindowsSdkPackageVersion>10.0.22621.28</WindowsSdkPackageVersion> -->
26+
This means that the two packages below must be aligned with the "build" version number of
27+
the "Microsoft.Windows.SDK.BuildTools" package above, and the "revision" version number
28+
must be the highest found in https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref.
29+
-->
30+
<!-- <WindowsSdkPackageVersion>10.0.22621.28</WindowsSdkPackageVersion> -->
3131

32-
<!--
33-
UnoFeatures let's you quickly add and manage implicit package references based on the features you want to use.
34-
https://aka.platform.uno/singleproject-features
35-
-->
36-
<UnoFeatures>
37-
Material;
38-
Dsp;
39-
Hosting;
40-
Toolkit;
41-
Logging;
42-
MVUX;
43-
Configuration;
44-
Localization;
45-
Navigation;
46-
ThemeService;
47-
Serialization;
48-
Storage;
49-
</UnoFeatures>
50-
</PropertyGroup>
51-
<ItemGroup>
52-
<PackageReference Include="CommunityToolkit.WinUI.Converters" />
53-
</ItemGroup>
54-
<ItemGroup>
55-
<UnoImage Include="Assets\Images\*" />
56-
<Resource Include="Assets\Samples\*.txt" CopyToOutputDirectory="PreserveNewest" />
57-
<UnoSplashScreen Include="Assets\SplashScreens\*" />
58-
</ItemGroup>
59-
<ItemGroup>
60-
<ProjectReference Include="..\DevTKSS.Extensions.Uno.Storage\DevTKSS.Extensions.Uno.Storage.csproj" />
61-
</ItemGroup>
32+
<!--
33+
UnoFeatures let's you quickly add and manage implicit package references based on the features you want to use.
34+
https://aka.platform.uno/singleproject-features
35+
-->
36+
<UnoFeatures>
37+
Material;
38+
Dsp;
39+
Hosting;
40+
Toolkit;
41+
Logging;
42+
MVUX;
43+
Configuration;
44+
Localization;
45+
Navigation;
46+
ThemeService;
47+
Serialization;
48+
Storage;
49+
</UnoFeatures>
50+
</PropertyGroup>
51+
<ItemGroup>
52+
<PackageReference Include="CommunityToolkit.WinUI.Converters" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<UnoImage Include="Assets\Images\*" />
56+
<Resource Include="Assets\Samples\*.txt" CopyToOutputDirectory="PreserveNewest" />
57+
<UnoSplashScreen Include="Assets\SplashScreens\*" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<ProjectReference Include="..\DevTKSS.Extensions.Uno.Storage\DevTKSS.Extensions.Uno.Storage.csproj" />
61+
</ItemGroup>
6262

6363
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
namespace DevTKSS.Uno.Samples.MvuxGallery.Models.GalleryImages;
22

3-
public partial record GalleryImageModel(string Title, string ImageLocation, string Description);
3+
public partial record GalleryImage(string Title, string ImageLocation, string Description);

0 commit comments

Comments
 (0)