This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum VideoState | |
{ | |
Idle, | |
Playing, | |
Paused, | |
Stopped | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class App : Application | |
{ | |
public App() | |
{ | |
InitializeComponent(); | |
RxApp.DefaultExceptionHandler = new RxExceptionHandler(); | |
Instance.InitializeForms(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ReactiveToDoSample.ViewModels | |
{ | |
public class ItemViewModel : ViewModelBase | |
{ | |
public ItemViewModel(IParameterViewStackService navigationService, IItemManager itemManager) : base(navigationService) | |
{ | |
_itemManager = itemManager; | |
var canExecute = this.WhenAnyValue(x => x.Title, (title) => !string.IsNullOrEmpty(title)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<rxui:ReactiveContentPage | |
x:Class="ReactiveToDoSample.Views.ItemPage" | |
xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:rxui="clr-namespace:ReactiveUI.XamForms;assembly=ReactiveUI.XamForms" | |
xmlns:vm="clr-namespace:ReactiveToDoSample.ViewModels" | |
x:TypeArguments="vm:ItemViewModel"> | |
<rxui:ReactiveContentPage.ToolbarItems> | |
<ToolbarItem Command="{Binding CloseCommand}" Text="Close" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ReactiveToDoSample.ViewModels | |
{ | |
public class HomeViewModel : ViewModelBase | |
{ | |
public HomeViewModel(IParameterViewStackService navigationService, IItemManager itemManager) : base(navigationService) | |
{ | |
DeleteCommand = ReactiveCommand.Create<Item>(itemManager.Remove); | |
itemManager | |
.ItemChanges |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<rxui:ReactiveContentPage | |
x:Class="ReactiveToDoSample.Views.HomePage" | |
xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:rxui="clr-namespace:ReactiveUI.XamForms;assembly=ReactiveUI.XamForms" | |
xmlns:vm="clr-namespace:ReactiveToDoSample.ViewModels" | |
x:Name="homePage" | |
Title="Reactive ToDo" | |
x:TypeArguments="vm:HomeViewModel"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ItemManager : IItemManager | |
{ | |
public ItemManager() | |
{ | |
ItemChanges = _itemsCache.Connect() | |
.RefCount(); | |
} | |
public Optional<Item> Get(string id) => _itemsCache.Lookup(id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ReactiveToDoSample.Managers | |
{ | |
public interface IItemManager | |
{ | |
public IObservable<IChangeSet<Item, string>> ItemChanges { get; } | |
public Optional<Item> Get(string id); | |
public void AddOrUpdate(Item item); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ReactiveToDoSample.Models | |
{ | |
public class Item : ReactiveObject | |
{ | |
public Item(string id, string title) | |
{ | |
Id = id; | |
Title = title; | |
} |