I'm trying to use the DecelerationEnded callback in conjunction with 'Tapped' callbacks on MT.Dialog elements. I can't get the two to work at the same time.
When the DecelerationEnded callback is commented out, the 'tapped' callbacks work. When it's commented in, the 'tapped' callbacks don't get triggered anymore (whereas DecelerationEnded does).
When the DecelerationEnded call is moved above the setting of the Root, then the button 'tapped' callbacks work, but the DecelerationEnded callback doesn't. Delaying the callback setup until ViewWillAppear also doesn't fix anything.
Any solutions?
Example code:
public class TestController : DialogViewController
{
public TestController () : base(UITableViewStyle.Plain, null, true)
{
// Create list of 20 buttons.
Section s = new Section();
for (int i = 0; i < 20; i++ )
{
s.Add(new StringElement("test " + i, () => {
Console.WriteLine("Tapped"); // Tapped callback.
}));
}
Root = new RootElement("Test") {s};
// The following line causes all the "tapped" handlers to not work.
this.TableView.DecelerationEnded += HandleDecelerationEnded;
}
void HandleDecelerationEnded (object sender, EventArgs e)
{
Console.WriteLine ("Deceleration Ended");
}
}