private void SumAndPublish(IList <ShoppingList> allLists) { var done = allLists.Sum(d => d.NumberOfCompletedItems); var total = allLists.Sum(d => d.NumberOfItems); var sd = new SummaryData() { TotalItems = total, DoneItems = done }; TinyPubSub.Publish <SummaryData>("SummaryData", sd); }
public DuckViewModel() { TinyPubSub.Subscribe(this, "fire", () => { // This line should not be fired when the page is navigated away from int i = 10; }); TinyPubSubLib.TinyPubSubForms.SubscribeOnMainThread("onmain", (obj) => { DuckCount++; PropertyChanged(this, new PropertyChangedEventArgs("DockCount")); }); }
public MainViewModel() { TinyPubSub.Subscribe("fire", () => { // Do something here, but nuget was down at the time of writing this code }); TinyPubSub.Subscribe <bool>("firebool", (obj) => { _toggleBool = obj; TheBool = _toggleBool; }); TinyPubSubLib.TinyPubSubForms.SubscribeOnMainThread("onmain", (obj) => { DuckCount++; PropertyChanged(this, new PropertyChangedEventArgs("DuckCount")); }); }
public BillingObserver() { TinyPubSub.Subscribe(Topics.Orders, (x) => BillOrderCommand(x)); }
public ShippingObserver() { TinyPubSub.Subscribe(Topics.Orders, (x) => ShipOrderCommand(x)); }
public ShoppingBaseModel() { TinyPubSub.Register(this); }
public void Post() { TinyPubSub.Publish(Topics.Orders, "A little bit of event data"); }