-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
197 additions
and
34 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
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
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
25 changes: 25 additions & 0 deletions
25
NonsPlayer/Components/ViewModels/Local/LocalArtistItemViewModel.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,25 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.Mvvm.Input; | ||
using NonsPlayer.Core.Models; | ||
using NonsPlayer.Core.Utils; | ||
using NonsPlayer.Helpers; | ||
using NonsPlayer.Services; | ||
using System.Diagnostics; | ||
using Windows.Storage; | ||
using Windows.Storage.Pickers; | ||
using FileAttributes = Windows.Storage.FileAttributes; | ||
|
||
namespace NonsPlayer.Components.ViewModels; | ||
|
||
[INotifyPropertyChanged] | ||
public partial class LocalArtistItemViewModel | ||
{ | ||
[ObservableProperty] private string name; | ||
[ObservableProperty] private string count; | ||
|
||
public void Init(LocalArtist artist) | ||
{ | ||
Name = artist.Name; | ||
Count = artist.Songs.Count.ToString(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<UserControl | ||
x:Class="NonsPlayer.Components.Views.LocalArtistItem" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<StackPanel> | ||
<TextBlock Text="{x:Bind ViewModel.Name, Mode=OneWay}"/> | ||
<TextBlock Text="{x:Bind ViewModel.Count, Mode=OneWay}"/> | ||
</StackPanel> | ||
</Grid> | ||
</UserControl> |
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,39 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using CommunityToolkit.WinUI.UI.Controls; | ||
using Microsoft.UI.Input; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Input; | ||
using Microsoft.UI.Xaml.Media; | ||
using Microsoft.UI.Xaml.Media.Animation; | ||
using NonsPlayer.Components.Models; | ||
using NonsPlayer.Components.ViewModels; | ||
using NonsPlayer.Core.Contracts.Models.Music; | ||
using NonsPlayer.Core.Models; | ||
using NonsPlayer.Core.Services; | ||
using NonsPlayer.Helpers; | ||
using NonsPlayer.ViewModels; | ||
using System.Collections.ObjectModel; | ||
using Windows.UI.Core; | ||
|
||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
namespace NonsPlayer.Components.Views; | ||
|
||
[INotifyPropertyChanged] | ||
public sealed partial class LocalArtistItem : UserControl | ||
{ | ||
public LocalArtistItem() | ||
{ | ||
ViewModel = App.GetService<LocalArtistItemViewModel>(); | ||
ProtectedCursor = InputCursor.CreateFromCoreCursor(new CoreCursor(CoreCursorType.Hand, 0)); | ||
InitializeComponent(); | ||
} | ||
|
||
public LocalArtist Artist | ||
{ | ||
set => ViewModel.Init(value); | ||
} | ||
|
||
public LocalArtistItemViewModel ViewModel { get; } | ||
} |
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
Oops, something went wrong.