add Recommendation
This commit is contained in:
1 parent
ee4125e2bf
commit
cf5f84869d
33 files changed
+320
-141
No files matched your search
@@ -1,24 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class ContributorsViewModel : DemoViewModelBase<ContributorModel>
|
||||
{
|
||||
public ContributorsViewModel(DataService dataService)
|
||||
{
|
||||
#if netle40
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
DataList = dataService.GetContributorDataList();
|
||||
});
|
||||
#else
|
||||
Task.Run(() =>
|
||||
{
|
||||
DataList = dataService.GetContributorDataList();
|
||||
});
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using HandyControlDemo.Data;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class ItemsDisplayViewModel : DemoViewModelBase<AvatarModel>
|
||||
{
|
||||
public ItemsDisplayViewModel(Func<List<AvatarModel>> getDatAction)
|
||||
{
|
||||
#if netle40
|
||||
Task.Factory.StartNew(() => DataList = getDatAction?.Invoke());
|
||||
#else
|
||||
Task.Run(() => DataList = getDatAction?.Invoke());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.CommandWpf;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Tools;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class NoUserViewModel : ViewModelBase
|
||||
{
|
||||
public RelayCommand<string> OpenViewCmd => new Lazy<RelayCommand<string>>(() =>
|
||||
new RelayCommand<string>(OpenView)).Value;
|
||||
|
||||
private void OpenView(string viewName)
|
||||
{
|
||||
Messenger.Default.Send<object>(null, MessageToken.ClearLeftSelected);
|
||||
Messenger.Default.Send(true, MessageToken.FullSwitch);
|
||||
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{viewName}"), MessageToken.LoadShowContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user