private void OnFormChanged(View v) { ThreadPool.QueueUserWorkItem(delegate { Console.WriteLine("Thread working in formchanged event!"); try { FormChanged?.Invoke(null, new XFormChangedEventArgs() { }); //handle group show/hide foreach (Groups g in FormGroups) { View groupView = MainFormLayout.FindViewWithTag(g.id); if (groupView != null) { Bindings binding = DLL.GetBindingByReference(g.reference); if (binding != null && binding.relevant != null) { var eval = XForm.Evaluate(binding.relevant); if (eval != null) { RunOnUiThread(() => { groupView.Visibility = (bool)eval ? ViewStates.Visible : ViewStates.Gone; }); } } } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }); }