-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
ccca249
commit 74df80e
Showing
6 changed files
with
64 additions
and
18 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
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
46 changes: 46 additions & 0 deletions
46
samples/todoapp/TodoApp.WinUI3/ViewModels/TodoItemViewModel.cs
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using System; | ||
using TodoApp.WinUI3.Database; | ||
|
||
namespace TodoApp.WinUI3.ViewModels; | ||
|
||
public partial class TodoItemViewModel(TodoItem todoItem) : ObservableObject | ||
{ | ||
public readonly TodoItem _todoItem = todoItem; | ||
|
||
public string Title | ||
{ | ||
get => this._todoItem.Title; | ||
set => SetProperty(this._todoItem.Title, value, this._todoItem, (item, value) => item.Title = value); | ||
} | ||
|
||
public bool IsComplete | ||
{ | ||
get => this._todoItem.IsComplete; | ||
set => SetProperty(this._todoItem.IsComplete, value, this._todoItem, (item, value) => item.IsComplete = value); | ||
} | ||
|
||
public string Version | ||
{ | ||
get => this._todoItem.Version; | ||
set => SetProperty(this._todoItem.Version, value, this._todoItem, (item, value) => item.Version = value); | ||
} | ||
|
||
public string Id => _todoItem.Id; | ||
|
||
public DateTimeOffset? UpdatedAt | ||
{ | ||
get => this._todoItem.UpdatedAt; | ||
set => SetProperty(this._todoItem.UpdatedAt, value, this._todoItem, (item, value) => item.UpdatedAt = value); | ||
} | ||
|
||
public bool Deleted | ||
{ | ||
get => this._todoItem.Deleted; | ||
set => SetProperty(this._todoItem.Deleted, value, this._todoItem, (item, value) => item.Deleted = value); | ||
} | ||
} |
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