Skip to content

Instantly share code, notes, and snippets.

PulkitSethi1984

Block or report user

Report or block PulkitSethi1984

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View NotificationsViewModel.cs
public class NotificationsViewModel : AppBaseViewModel
{
private readonly INotificationService _notificationService;
private readonly INotificationPresenter _presenter;
public NotificationsViewModel(INotificationPresenter presenter, INotificationService notificationService)
{
_presenter = presenter;
_notificationService = notificationService;
}
View INotificationService.cs
public interface INotificationsService
{
Task LoadNotifications();
ObservableProperty<int> NotificationsCount { get; }
}
View ObservableProperty.cs
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;
View IObservableObject.cs
public interface IObservableObject<T>
{
Guid Subscribe(Action<T> onNext);
void Unsubscribe(Guid guid);
}
View SearchViewModel.cs
private async Task BeginSearch()
{
ShowBusy = true;
await _navigationService.NavigateToAsync<AllItemsViewModel>(SearchText);
ShowBusy = false;
}
View NavigationService.cs
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
{
View BaseView.cs
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()
View AppContainer.cs
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
View INavigationService.cs
using System;
using System.Threading.Tasks;
namespace App.Common.Core.Services.App
{
public interface INavigationService
{
Task NavigateToAsync<TViewModel>(object parameter);
}
}
View BaseViewModel.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace App.Common.Core.ViewModels
You can’t perform that action at this time.