Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion samples/todoapp/TodoApp.Uno/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
<ItemGroup>
<PackageVersion Include="CommunityToolkit.WinUI.Behaviors" Version="8.1.240916" />
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.1.240916" />
<PackageVersion Include="CommunityToolkit.Datasync.Client" Version="9.0.0" />
<PackageVersion Include="Refit" Version="8.0.0" />
<PackageVersion Include="System.Formats.Asn1" Version="9.0.0" />
<PackageVersion Include="System.IO.Packaging" Version="9.0.0" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Text.Json" Version="9.0.2" />
</ItemGroup>
</Project>
</Project>
11 changes: 0 additions & 11 deletions samples/todoapp/TodoApp.Uno/TodoApp.Uno.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "library", "library", "{0AAB65A5-8A90-47AF-AAED-AF27E82D50A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Datasync.Client", "..\..\..\src\CommunityToolkit.Datasync.Client\CommunityToolkit.Datasync.Client.csproj", "{2D6F113F-D3A1-43A5-BF57-E72E5D5F5963}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -30,17 +26,10 @@ Global
{5FD4876C-302E-42DF-B28B-55035009E545}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FD4876C-302E-42DF-B28B-55035009E545}.Release|Any CPU.Build.0 = Release|Any CPU
{5FD4876C-302E-42DF-B28B-55035009E545}.Release|Any CPU.Deploy.0 = Release|Any CPU
{2D6F113F-D3A1-43A5-BF57-E72E5D5F5963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D6F113F-D3A1-43A5-BF57-E72E5D5F5963}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D6F113F-D3A1-43A5-BF57-E72E5D5F5963}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D6F113F-D3A1-43A5-BF57-E72E5D5F5963}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2D6F113F-D3A1-43A5-BF57-E72E5D5F5963} = {0AAB65A5-8A90-47AF-AAED-AF27E82D50A4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EA315B6A-4F6C-4482-A88B-61900C1B6934}
EndGlobalSection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ public LoggingHandler(HttpMessageHandler innerHandler) : base(innerHandler)
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
Debug.WriteLine($"[HTTP] >>> {request.Method} {request.RequestUri}");
await WriteContentAsync(request.Content, cancellationToken);
if (request.Content is not null)
{
await WriteContentAsync(request.Content, cancellationToken);
}

HttpResponseMessage response = await base.SendAsync(request, cancellationToken);

Debug.WriteLine($"[HTTP] <<< {response.StatusCode} {response.ReasonPhrase}");
await WriteContentAsync(response.Content, cancellationToken);
if (response.Content is not null)
{
await WriteContentAsync(response.Content, cancellationToken);
}

return response;
}
Expand Down
6 changes: 2 additions & 4 deletions samples/todoapp/TodoApp.Uno/TodoApp.Uno/TodoApp.Uno.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Navigation;
</UnoFeatures>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

</PropertyGroup>
<ItemGroup>
<None Remove="Assets\AddItem.png" />
Expand All @@ -54,15 +54,13 @@
<None Remove="Assets\Wide310x150Logo.scale-200.png" />
<None Remove="Views\TodoListPage.xaml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\src\CommunityToolkit.Datasync.Client\CommunityToolkit.Datasync.Client.csproj" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Remove="Views\TodoListPage.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" />
<PackageReference Include="CommunityToolkit.WinUI.Converters" />
<PackageReference Include="CommunityToolkit.Datasync.Client" />
<PackageReference Include="System.Formats.Asn1" />
<PackageReference Include="System.IO.Packaging" />
<PackageReference Include="System.Private.Uri" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,42 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TodoApp.Uno.Database;

namespace TodoApp.Uno.ViewModels
#nullable disable

namespace TodoApp.Uno.ViewModels;

public partial class TodoItemViewModel(TodoItem todoItem) : ObservableObject
{
public partial class TodoItemViewModel(TodoItem todoItem) : ObservableObject
public readonly TodoItem _todoItem = todoItem;

public string Title
{
get => _todoItem.Title;
set => SetProperty(_todoItem.Title, value, _todoItem, (item, value) => item.Title = value);
}

public bool IsComplete
{
get => _todoItem.IsComplete;
set => SetProperty(_todoItem.IsComplete, value, _todoItem, (item, value) => item.IsComplete = value);
}

public string Version
{
get => _todoItem.Version;
set => SetProperty(_todoItem.Version, value, _todoItem, (item, value) => item.Version = value);
}

public string Id => _todoItem.Id;

public DateTimeOffset? UpdatedAt
{
get => _todoItem.UpdatedAt;
set => SetProperty(_todoItem.UpdatedAt, value, _todoItem, (item, value) => item.UpdatedAt = value);
}

public bool Deleted
{
public readonly TodoItem _todoItem = todoItem;

public string Title
{
get => _todoItem.Title;
set => SetProperty(_todoItem.Title, value, _todoItem, (item, value) => item.Title = value);
}

public bool IsComplete
{
get => _todoItem.IsComplete;
set => SetProperty(_todoItem.IsComplete, value, _todoItem, (item, value) => item.IsComplete = value);
}

public string Version
{
get => _todoItem.Version;
set => SetProperty(_todoItem.Version, value, _todoItem, (item, value) => item.Version = value);
}

public string Id => _todoItem.Id;

public DateTimeOffset? UpdatedAt
{
get => _todoItem.UpdatedAt;
set => SetProperty(_todoItem.UpdatedAt, value, _todoItem, (item, value) => item.UpdatedAt = value);
}

public bool Deleted
{
get => _todoItem.Deleted;
set => SetProperty(_todoItem.Deleted, value, _todoItem, (item, value) => item.Deleted = value);
}
get => _todoItem.Deleted;
set => SetProperty(_todoItem.Deleted, value, _todoItem, (item, value) => item.Deleted = value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using CommunityToolkit.Datasync.Client;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.EntityFrameworkCore;
using TodoApp.Uno.Database;

#nullable disable

namespace TodoApp.Uno.ViewModels;

/// <summary>
Expand Down