void ReleaseDesignerOutlets() { if (StarButton != null) { StarButton.Dispose(); StarButton = null; } if (WatchButton != null) { WatchButton.Dispose(); WatchButton = null; } }
private void DisposeGestures() { if (_cellTapGesture != null) { RemoveGestureRecognizer(_cellTapGesture); _cellTapGesture.Dispose(); _cellTapGesture = null; } if (_starTapGesture != null) { StarButton.RemoveGestureRecognizer(_starTapGesture); _starTapGesture.Dispose(); _starTapGesture = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); StarButton.BackgroundColor = UIColor.FromRGB(0x2c, 0x3e, 0x50); StarButton.SetTitleColor(UIColor.White, UIControlState.Normal); StarButton.Layer.CornerRadius = 6f; WatchButton.BackgroundColor = UIColor.FromRGB(0x7f, 0x8c, 0x8d); WatchButton.SetTitleColor(UIColor.White, UIControlState.Normal); WatchButton.Layer.CornerRadius = 6f; OnActivation(d => { d(WatchButton.GetClickedObservable().Subscribe(_ => WatchCodeHub())); d(StarButton.GetClickedObservable().Subscribe(_ => StarCodeHub())); }); }
void ReleaseDesignerOutlets() { if (BottomBorderLeftConstraint != null) { BottomBorderLeftConstraint.Dispose(); BottomBorderLeftConstraint = null; } if (DescriptionAndDetailsSpaceConstraint != null) { DescriptionAndDetailsSpaceConstraint.Dispose(); DescriptionAndDetailsSpaceConstraint = null; } if (DescriptionLabel != null) { DescriptionLabel.Dispose(); DescriptionLabel = null; } if (DetailsButton != null) { DetailsButton.Dispose(); DetailsButton = null; } if (DetailsLabel != null) { DetailsLabel.Dispose(); DetailsLabel = null; } if (EndTimeLabel != null) { EndTimeLabel.Dispose(); EndTimeLabel = null; } if (LocationAndDescriptionConstraint != null) { LocationAndDescriptionConstraint.Dispose(); LocationAndDescriptionConstraint = null; } if (LocationLabel != null) { LocationLabel.Dispose(); LocationLabel = null; } if (NavigateOnMapButton != null) { NavigateOnMapButton.Dispose(); NavigateOnMapButton = null; } if (Separator != null) { Separator.Dispose(); Separator = null; } if (StarButton != null) { StarButton.Dispose(); StarButton = null; } if (StartTimeLabel != null) { StartTimeLabel.Dispose(); StartTimeLabel = null; } if (ThumbHeightConstraint != null) { ThumbHeightConstraint.Dispose(); ThumbHeightConstraint = null; } if (ThumbImageView != null) { ThumbImageView.Dispose(); ThumbImageView = null; } if (ThumbLabel != null) { ThumbLabel.Dispose(); ThumbLabel = null; } if (ThumbLabelView != null) { ThumbLabelView.Dispose(); ThumbLabelView = null; } if (ThumbLeftConstraint != null) { ThumbLeftConstraint.Dispose(); ThumbLeftConstraint = null; } if (ThumbTopConstraint != null) { ThumbTopConstraint.Dispose(); ThumbTopConstraint = null; } if (ThumbWidthConstraint != null) { ThumbWidthConstraint.Dispose(); ThumbWidthConstraint = null; } if (TimeBackgroundView != null) { TimeBackgroundView.Dispose(); TimeBackgroundView = null; } if (TimeTopConstraint != null) { TimeTopConstraint.Dispose(); TimeTopConstraint = null; } if (TitleAndLocationConstraint != null) { TitleAndLocationConstraint.Dispose(); TitleAndLocationConstraint = null; } if (TitleLabel != null) { TitleLabel.Dispose(); TitleLabel = null; } if (TitleLeftConstraint != null) { TitleLeftConstraint.Dispose(); TitleLeftConstraint = null; } }
private void InitializeGestures() { _cellTapGesture = new UITapGestureRecognizer(rec => { if (IsExpanded && DataContext.Show.HasPictures() && rec.LocatedInView(ThumbImageView)) { var context = new ModalViewContext( ModalViewKind.FullscreenImage, DataContext.Show.Pictures.Full); if (ShowHideModalViewCommand != null && ShowHideModalViewCommand.CanExecute(context)) { ShowHideModalViewCommand.Execute(context); } } else if (IsExpanded && DataContext.Show.HasDetailsUrl() && rec.LocatedInView(this, new CGRect(0, Bounds.Height - DetailsTapAreaHeight, DetailsLabel.Frame.X + DetailsLabel.Frame.Width + HorizontalBorder, DetailsTapAreaHeight))) { NavigateDetails(); } else if (IsExpanded && DataContext.IsLocationAvailable && rec.LocatedInView(this, new CGRect(0, LocationLabel.Frame.Y, LocationLabel.Frame.X + LocationLabel.Frame.Width + HorizontalBorder, LocationLabel.Frame.Height))) { if (NavigateVenueOnMapCommand != null && NavigateVenueOnMapCommand.CanExecute(DataContext.TargetVenue)) { NavigateVenueOnMapCommand.Execute(DataContext.TargetVenue); } } else { if (ExpandCollapseShowCommand != null && ExpandCollapseShowCommand.CanExecute(DataContext.Show)) { ExpandCollapseShowCommand.Execute(DataContext.Show); } } }) { NumberOfTouchesRequired = (uint)1, NumberOfTapsRequired = (uint)1 }; AddGestureRecognizer(_cellTapGesture); _starTapGesture = new UITapGestureRecognizer(() => { if (DataContext != null) { DataContext.IsFavorite = !DataContext.IsFavorite; UpdateFavoriteState(); var tuple = new Tuple <int, Show>(DataContext.OrgEventId, DataContext.Show); if (DataContext.IsFavorite) { if (SetFavoriteCommand.CanExecute(tuple)) { SetFavoriteCommand.Execute(tuple); } } else { if (UnsetFavoriteCommand.CanExecute(tuple)) { UnsetFavoriteCommand.Execute(tuple); } } } }); StarButton.AddGestureRecognizer(_starTapGesture); }