private void UpdateText(object state) { try { Debug.WriteLine("updatetext: "+state as string); Text = state as string; } catch (Exception error) { #if DEBUG Debug.Fail(error.Message); #endif } }