Example #1
0
        private async void ObserveExplorerNavigation(int index)
        {
            if (_entities != null && index >= 0 && index < _entities.Count)
            {
                var entity = _entities[index];
                if (entity.IsHeader)
                {
                    // HACK: do not allow header selection
                    await Task.Delay(1);

                    SelectedEntityIndex = _prevIndex;

                    var segment = (Segment)entity;
                    SegmentSelected?.Invoke(this, segment);
                }
                else if (index != _prevIndex)
                {
                    SelectedEntityIndex = index;
                    _prevIndex          = index;

                    await Task.Delay(250);

                    var conversation = (Conversation)entity;
                    _navigator.Go(new Topic(conversation.Chat));
                }
            }
        }
 /// <summary>
 /// custom implementaton - raise the <see cref="SegmentSelected"/> event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 public virtual void OnSegmentSelected(object sender, SegmentSelectedEventArgs args)
 {
     SegmentSelected?.Invoke(sender, args);
 }