private void Start() { if (Orientation == NavigationOrientation.None) { throw new InvalidOperationException( $"NavigationContainer is missing orientation value on gameObject {gameObject.ToHierarchyPath()}"); } var items = Items != null && Items.Length > 0 ? Items : this.Children(); var direction = Orientation == NavigationOrientation.Horizontal ? MoveDirection.Right : MoveDirection.Down; items .Pairwise() .ForEach(x => _navigationHandler.BindBidirectional(x.Previous, x.Current, direction)); }
public void Start() { _chosenIndex = TabListControl.ChosenIndex.Value ?? 0; TabListControl.ChosenIndex .WhereNotNull() .LazyThrottle(TimeSpan.FromSeconds(SelectionDelay)) .DistinctUntilChanged() .SelectMany(x => ShowContent(x ?? 0)) .Subscribe(x => _contentView.Value = x) .AddTo(this); _navigationHandler.BindBidirectional( ContentTransitionControl, TabListControl, (MoveDirection)TabPlacement, () => _chosenIndex == TabListControl.ChosenIndex.Value && MutableState.Value != PresenterState.Presenting && ContentTransitionControl.FirstView.Value != null); _navigationHandler.BindCancel( ContentTransitionControl, TabListControl); }