Exemplo n.º 1
0
 private void Select(SelectionModel manager, int groupIndex, int itemIndex, bool select)
 {
     Log.Comment((select ? "Selecting " : "DeSelecting ") + groupIndex + "." + itemIndex);
     if (select)
     {
         manager.Select(groupIndex, itemIndex);
     }
     else
     {
         manager.Deselect(groupIndex, itemIndex);
     }
 }
Exemplo n.º 2
0
        //[TestMethod]
        //public void CanReadSelectedItemViaICustomPropertyProvider()
        //{
        //    RunOnUIThread.Execute(() =>
        //    {
        //        var selectionModel = new SelectionModel();
        //        Log.Comment("Set the source to 10 items");
        //        selectionModel.Source = Enumerable.Range(0, 10).ToList();

        //        selectionModel.Select(3);

        //        var icpp = (ICustomPropertyProvider)selectionModel;
        //        var selectedItemProperty = icpp.GetCustomProperty("SelectedItem");
        //        Verify.IsTrue(selectedItemProperty.CanRead);
        //        Verify.AreEqual(3, selectedItemProperty.GetValue(selectionModel));
        //    });
        //}

        private void Select(SelectionModel manager, int index, bool select)
        {
            Log.Comment((select ? "Selecting " : "DeSelecting ") + index);
            if (select)
            {
                manager.Select(index);
            }
            else
            {
                manager.Deselect(index);
            }
        }