TextBox: How to Capture Inputs from Users
Hey again! I'm trying to capture User Inputs for an inventory search (typing into a search field), and started by setting up a Textbox for that, but I'm running into some challenges getting it off the ground.
1) I can't seem to capture any keyboard inputs into the textbox. Even with the unmodified stock textbox it won't capture and display the input characters like we see in the examples here: https://www.noesisengine.com/xamltoy/09 ... dbdef89f8c. I even copied this textbox in to test, and it didn't work.
Once I can figure out how to get the inputs to register and display, my goal is to have the search work for my inventory items: I would make a string property for "SearchTextInput" on the my viewmodel and then I would create a two-way binding for the text property of the textbox, with a propertychanged update parameter so that each time the user changes what's typed in the textbox, it would update the data for SearchTextInput so that I can access that for logic to apply to the inventory listbox, etc.
2) When I try to customize the textbox by creating a new template, the default template unfortunately loses the display of the placeholder text and I can't seem to find where it is being bound under the hood as there is only the one textblock inside the content presenter.
Any input on how to resolve these two steps would be great!
1) I can't seem to capture any keyboard inputs into the textbox. Even with the unmodified stock textbox it won't capture and display the input characters like we see in the examples here: https://www.noesisengine.com/xamltoy/09 ... dbdef89f8c. I even copied this textbox in to test, and it didn't work.
Once I can figure out how to get the inputs to register and display, my goal is to have the search work for my inventory items: I would make a string property for "SearchTextInput" on the my viewmodel and then I would create a two-way binding for the text property of the textbox, with a propertychanged update parameter so that each time the user changes what's typed in the textbox, it would update the data for SearchTextInput so that I can access that for logic to apply to the inventory listbox, etc.
2) When I try to customize the textbox by creating a new template, the default template unfortunately loses the display of the placeholder text and I can't seem to find where it is being bound under the hood as there is only the one textblock inside the content presenter.
Any input on how to resolve these two steps would be great!
Re: TextBox: How to Capture Inputs from Users
1) This is an integration issue right? Not a studio thing. Is your view correctly injecting KeyDown/Char/KeyUp events? Does the XAML work correctly in XamlPlayer
2) We are having a look at this right now
2) We are having a look at this right now
Re: TextBox: How to Capture Inputs from Users
Ticket #4291 created for 2)
Re: TextBox: How to Capture Inputs from Users
Hey Jsantos,
1) I suspect you're right. This is all within play mode inside of studio. The textboxes work properly when I test them in isolation in xamltoy, so I'm thinking there must be something I need to do to preview/test the behaviour in studio before integrating in Unity. I was hoping to test my data-binding for user inputs in studio before trying to build it in Unity. I discovered I was able to select then copy & paste into the search bar, so that will work for testing the binding, but while running in play mode in studio, the textbox isn't capturing/displaying character inputs when selected. I'm guessing that's by design or that I need to enable/create some kind of injection handling in studio if I want to test it there?
2) Thanks! I appreciate it!
1) I suspect you're right. This is all within play mode inside of studio. The textboxes work properly when I test them in isolation in xamltoy, so I'm thinking there must be something I need to do to preview/test the behaviour in studio before integrating in Unity. I was hoping to test my data-binding for user inputs in studio before trying to build it in Unity. I discovered I was able to select then copy & paste into the search bar, so that will work for testing the binding, but while running in play mode in studio, the textbox isn't capturing/displaying character inputs when selected. I'm guessing that's by design or that I need to enable/create some kind of injection handling in studio if I want to test it there?
2) Thanks! I appreciate it!
Re: TextBox: How to Capture Inputs from Users
1) This seems to be a bug in Studio. Could you please attach a minimal XAML reproducing the issue?
Re: TextBox: How to Capture Inputs from Users
Sure, please find the project as, which contains Page0.xaml, which is not capturing character inputs, but is capturing copy & paste, on Version 0.1.227 beta1) This seems to be a bug in Studio. Could you please attach a minimal XAML reproducing the issue?
Re: TextBox: How to Capture Inputs from Users
We already fixed (1) for the next version. Thanks for your feedback!
Re: TextBox: How to Capture Inputs from Users
Awesome! Can't wait for the next version :-) I'll marked it solved.We already fixed (1) for the next version. Thanks for your feedback!
Who is online
Users browsing this forum: No registered users and 5 guests