Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace FiberStarMobileApp.Core.ViewModels.AttendanceViewModels
- {
- public class ListDetailAttendanceViewModel : BaseViewModel
- {
- private readonly IAttendanceService _service;
- private IMvxAsyncCommand _onCancelButtonCommand;
- public event PropertyChangedEventHandler PropertyChanged;
- HttpClient client = new HttpClient();
- private long _idItem;
- private MyModel _attend;
- private ImageSource _imgSelfieDetail;
- private bool _isLoadBusy = false;
- public ListDetailAttendanceViewModel(IMvxNavigationService navigationService, IAuthService authService, IAttendanceService service) : base(navigationService, authService)
- {
- _service = service;
- MessagingCenter.Unsubscribe<Pages.Attendance.ListAttendPage, long>(this, "OnItemSelected");
- MessagingCenter.Subscribe<Pages.Attendance.ListAttendPage, long>(this, "OnItemSelected", async (sender, value) =>
- {
- _idItem = value;
- await PerformShimmerAsyncTask(_idItem.ToString());
- });
- }
- public bool IsLoadBusy
- {
- get { return _isLoadBusy; }
- set
- {
- _isLoadBusy = value;
- OnPropertyChanged();
- }
- }
- public MyModel Attend
- {
- get { return _attend; }
- set { SetProperty(ref _attend, value); }
- }
- protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
- public ImageSource ImgSelfieDetail
- {
- get { return _imgSelfieDetail; }
- set { _imgSelfieDetail = value; RaisePropertyChanged(() => ImgSelfieDetail); }
- }
- public IMvxAsyncCommand OnCancelButtonCommand => _onCancelButtonCommand ??
- (_onCancelButtonCommand = new MvxAsyncCommand(OnCancelButton));
- private async Task OnCancelButton()
- {
- await NavigationService.Close(this);
- }
- public async Task PerformShimmerAsyncTask(string id)
- {
- this.Attend = new MyModel
- {
- //Image = null,
- AddressDetail = "x",
- Created = DateTime.Now,
- Activity = "x",
- Note = "x"
- };
- this.IsLoadBusy = true;
- await Task.Delay(2500);
- this.IsLoadBusy = false;
- //await GetItem(id);
- this.Attend = new MyModel
- {
- Image = "selfie.png",
- AddressDetail = "asdasdasda",
- Created = DateTime.Now,
- Activity = "sadasdasdasfacf",
- Note = "asuuusfasfa"
- };
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement