feat: Add Card control and card demo with album images.
This commit is contained in:
1 parent
e7005d09b5
commit
d6e16736e4
23 files changed
+287
-47
No files matched your search
@@ -0,0 +1,28 @@
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel;
|
||||
|
||||
public partial class CardDemoViewModel : DemoViewModelBase<CardModel>
|
||||
{
|
||||
private readonly DataService _dataService;
|
||||
|
||||
public CardDemoViewModel(DataService dataService)
|
||||
{
|
||||
_dataService = dataService;
|
||||
DataList = dataService.GetCardDataList();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void AddItem() => DataList.Insert(0, _dataService.GetCardData());
|
||||
|
||||
[RelayCommand]
|
||||
private void RemoveItem()
|
||||
{
|
||||
if (DataList.Count > 0)
|
||||
{
|
||||
DataList.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user