コード例 #1
0
ファイル: TSCollectionView.cs プロジェクト: hinohie/TizenFX
        public async Task CollectionViewGetNextFocusableView()
        {
            tlog.Debug(tag, $"CollectionViewGetNextFocusableView START");

            TaskCompletionSource <bool> tcs = new TaskCompletionSource <bool>(false);
            EventHandler onAddedToWindow    = (s, e) => { tcs.TrySetResult(true); };

            var model         = new TestModel();
            var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);

            testingTarget.AddedToWindow += onAddedToWindow;
            testingTarget.Size           = new Size(100, 100);

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <CollectionView>(testingTarget, "should be an instance of testing target class!");

            Window.Instance.Add(testingTarget);
            var result = await tcs.Task;

            Assert.IsTrue(result, "Relayout event should be invoked");

            testingTarget.GetNextFocusableView(null, View.FocusDirection.Down, false);
            tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);

            if (testingTarget != null)
            {
                Window.Instance.Remove(testingTarget);
                testingTarget.Dispose();
                testingTarget = null;
            }
            tlog.Debug(tag, $"CollectionViewGetNextFocusableView END (OK)");
        }