windows app display last update now correctly
This commit is contained in:
parent
836fcb3f4d
commit
51212f9354
1
RBLNews.Maui/IaC/build-android.ps1
Normal file
1
RBLNews.Maui/IaC/build-android.ps1
Normal file
@ -0,0 +1 @@
|
||||
dotnet publish -c Release -r android-arm64 -p:PackageFormat=Apk -f net8.0-android34.0 --sc true
|
||||
@ -46,6 +46,10 @@
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.26100.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- App Icon -->
|
||||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
|
||||
@ -76,4 +80,8 @@
|
||||
<ProjectReference Include="..\RBLNews.Shared\RBLNews.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="IaC\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<div class="top-row ps-3 navbar navbar-dark">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<Icon Name="IconName.InfoCircle" class="me-2"></Icon>Letztes Update @this.FeedDataService.Feeds?.LastUpdate.ToString("dd.MM.yyyy HH:mm")
|
||||
<Icon Name="IconName.InfoCircle" class="me-2"></Icon>Letztes Update @FeedDataService.Feeds?.LastUpdate.ToString("dd.MM.yyyy HH:mm")
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -49,4 +49,10 @@
|
||||
@code {
|
||||
[Inject]
|
||||
private IFeedDataService FeedDataService { get; set; }
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
FeedDataService.DataChanged= () => StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
@ -55,7 +55,6 @@ else
|
||||
protected async override Task OnInitializedAsync()
|
||||
{
|
||||
await FeedDataService.LoadFeeds();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private string GetRssSourceName(RssFeedSources source)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
|
||||
@ -8,6 +8,8 @@ namespace RBLNews.Shared.Services
|
||||
{
|
||||
public RssVM Feeds { get; }
|
||||
|
||||
public Action DataChanged { get; set; }
|
||||
|
||||
Task LoadFeeds();
|
||||
}
|
||||
|
||||
@ -17,9 +19,12 @@ namespace RBLNews.Shared.Services
|
||||
|
||||
public RssVM Feeds { get; private set; }
|
||||
|
||||
public Action DataChanged { get; set; }
|
||||
|
||||
public async Task LoadFeeds()
|
||||
{
|
||||
Feeds = await httpClient.GetFromJsonAsync<RssVM>("https://rblnews.de/api/feeds") ?? new RssVM();
|
||||
DataChanged.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user