Here is my sample code for anyone else in a similar situation: It works! Thank you very much for your suggestion. I have done as you suggested and extended the Android Button which calls uses "CallOnClick()" to trigger the click event on a timer. Var renderer = v.Tag as CustomControlRenderer Private void InvokeInitialClickListener() Void HandleTimerElapsed(object sender, ElapsedEventArgs e) Public class MyTouchListener :, ĬustomControlRenderer m圜ustomControlRenderer Ī myRelativeLayout public static readonly MyTouchListener Instance = new MyTouchListener() Is it because the timer cannot update the main thread? I put a breakpoint on my customControl binded property and i can see the setter for it is being called - but the value dosent change. Is there something i am missing here? Below is what my OnTouchListener looks like. I have tried creating a timer on the ondown Motion and updating the "SelectedValue" of the control on an interval while the button remains down - but the OnElementPropert圜hanged doesent fire in this case. This all works fine when i press the button once -> the OnElementPropert圜hanged event is fired and the UI updates. I have called SetOnTouchListener and created a function to SetOnTouchListener which increments the number when either of the buttons are pressed. I have then created a custom renderer which returns a relative layout with two buttons and a label. I have created a custom control extending from View with a bindable property for CurrentValue. I need to be able to hold the button down to increment the number - not tap on the button over and over. I need to show a + and - button and a label showing the current value. I have a requirement to develop a control similar to the Number Picker in Xamarin forms (where you have a + and - button to set a value).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |