Skip to content

Instantly share code, notes, and snippets.

View PulkitSethi1984's full-sized avatar

PulkitSethi1984

View GitHub Profile
using System;
using App.Common.Core.ViewModels;
using App.Common.Core.Services.Network;
using App.Common.Core.Services.Data;
using Autofac;
using Xamarin.Forms;
using System.Reflection;
using App.Common.Core.Services.App;
#if AUTOMATION
using System;
using System.Threading.Tasks;
using App.Common.Core.ViewModels;
using Xamarin.Forms;
namespace App.Common.Core.Views
{
public abstract class BaseView : ContentPage
{
public BaseView()
using System;
using System.Reflection;
using System.Threading.Tasks;
using App.Common.Core.ViewModels;
using Xamarin.Forms;
namespace App.Common.Core.Services.App
{
public class NavigationService : INavigationService
{
private async Task BeginSearch()
{
ShowBusy = true;
await _navigationService.NavigateToAsync<AllItemsViewModel>(SearchText);
ShowBusy = false;
}
public interface IObservableObject<T>
{
Guid Subscribe(Action<T> onNext);
void Unsubscribe(Guid guid);
}
public class ObservableProperty<T> : ExtendedBindableObject, IObservableObject<T>
{
readonly List<ValueObserver<T>> _subscribers = new List<ValueObserver<T>>();
T _value;
public virtual T Value
{
get
{
return _value;
public interface INotificationsService
{
Task LoadNotifications();
ObservableProperty<int> NotificationsCount { get; }
}
public class NotificationsViewModel : AppBaseViewModel
{
private readonly INotificationService _notificationService;
private readonly INotificationPresenter _presenter;
public NotificationsViewModel(INotificationPresenter presenter, INotificationService notificationService)
{
_presenter = presenter;
_notificationService = notificationService;
}