public static PriceTileViewCell Create() { PriceTileViewCell created = (PriceTileViewCell)Nib.Instantiate(null, null) [0]; created.ContentView.BackgroundColor = Styles.RTDarkerBlue; created.Notional.Delegate = new NotionalTextFieldDelegate(created); var numberToolbar = new UIToolbar(new RectangleF(0.0f, 0.0f, (float)created.Frame.Size.Width, 40.0f)); numberToolbar.Items = new UIBarButtonItem[] { new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Bordered, created, new ObjCRuntime.Selector("CancelNumberPad")), new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), new UIBarButtonItem(UIBarButtonSystemItem.Done, created, new ObjCRuntime.Selector("DoneNumberPad")) }; created.Notional.InputAccessoryView = numberToolbar; // // TODO: Reinstate change of notional currency once data model / back end support this. // For now we just disable the button (not that some relevant implementation of the button click remains). // created.NotionalCCY.UserInteractionEnabled = false; UserModel.Instance.OnChanged .Subscribe(created.OnUserModelChanged); created.DecorateWithTradingEnabled(UserModel.Instance.OneTouchTradingEnabled); return(created); }
private IPriceTileCell GetCell(UITableView tableView, PriceTileModel model) { IPriceTileCell priceTileCell = null; switch (model.Status) { case PriceTileStatus.Done: case PriceTileStatus.DoneStale: priceTileCell = tableView.DequeueReusableCell(PriceTileTradeAffirmationViewCell.Key) as PriceTileTradeAffirmationViewCell; if (priceTileCell == null) { priceTileCell = PriceTileTradeAffirmationViewCell.Create(); } break; case PriceTileStatus.Streaming: case PriceTileStatus.Executing: priceTileCell = tableView.DequeueReusableCell(PriceTileViewCell.Key) as PriceTileViewCell; if (priceTileCell == null) { priceTileCell = PriceTileViewCell.Create(); } break; case PriceTileStatus.Stale: priceTileCell = tableView.DequeueReusableCell(PriceTileErrorViewCell.Key) as PriceTileViewCell; if (priceTileCell == null) { priceTileCell = PriceTileErrorViewCell.Create(); } break; } return(priceTileCell); }