OSDN Git Service

TabModel.SelectedIndex プロパティを追加, TweenMain._curItemIndex フィールドを廃止
[opentween/open-tween.git] / OpenTween / Models / TabModel.cs
index 5f1674e..e8c485d 100644 (file)
@@ -81,6 +81,15 @@ namespace OpenTween.Models
         public PostClass SelectedPost
             => this.selectedStatusIds.Select(x => this.Posts[x]).FirstOrDefault();
 
+        public int SelectedIndex
+        {
+            get
+            {
+                var statusId = this.SelectedStatusId;
+                return statusId != -1 ? this.IndexOf(statusId) : -1;
+            }
+        }
+
         private IndexedSortedSet<long> _ids = new IndexedSortedSet<long>();
         private ConcurrentQueue<TemporaryId> addQueue = new ConcurrentQueue<TemporaryId>();
         private ConcurrentQueue<long> removeQueue = new ConcurrentQueue<long>();