Fix Popped event registration in InsertBefore
authorPiotr Bereza <p.bereza@samsung.com>
Wed, 14 Sep 2016 14:37:03 +0000 (16:37 +0200)
committerWonYoung Choi <wy80.choi@samsung.com>
Tue, 20 Sep 2016 01:00:36 +0000 (10:00 +0900)
Change-Id: I364bd12ed50ff28be065582a72699d404b28c09f
Signed-off-by: Piotr Bereza <p.bereza@samsung.com>
src/ElmSharp/ElmSharp/Naviframe.cs

index 051cdd5..1604f0a 100644 (file)
@@ -75,6 +75,11 @@ namespace ElmSharp
             NaviItem naviItem = NaviItem.FromNativeHandle(item, content);
             int idx = _itemStack.IndexOf(before);
             _itemStack.Insert(idx, naviItem);
+            naviItem.Popped += (s, e) =>
+            {
+                _itemStack.Remove(naviItem);
+                Popped?.Invoke(this, new NaviframeEventArgs() { Content = naviItem.Content });
+            };
             return naviItem;
         }