0
votes

okay, so i am now very frustrated about this topic on google, because no one asks the right questions.

i have a textbox on my windows phone 8 applications right.

now once i click on that textbox the SIP keyboard pops up(that part i get, it is done by the OS).

now what i want to do is once i click on the textbox i dont want the SIP to open up , cause it will navigate to a another page, but i cant make it a button cause the user can edit the info in the textbox once they chose the data from the other page.

now is there a property on windows phone textboxes that will restrict the keyboard from popping up?

and i cant make it read-only because that will not look good, and then the user will see the textbox as uneditable.

any links, code , or previous questions will be appreciated!

EDIT: I have also tried setting focus on some other control, but it doesn't happen fast enough so keyboard also pops up!,

I have no physical controls, my controls are all dynamic, depends on what is sent through the webservice:

Here is a sample! :

 else if (field.CtlType == WFCoreLib.DataModels.Generic.FieldAttributes.ControlType.ctFinder)
                        {
                            TextBox txtFindercontent = new TextBox();
                            txtFindercontent.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
                            //txtFindercontent.Text = field.FieldDescLoc.ToString();
                            txtFindercontent.SetValue(Grid.ColumnProperty, 1);
                            txtFindercontent.SetValue(Grid.RowProperty, count);
                            txtFindercontent.Width = 220;
                            txtFindercontent.FontSize = 20;
                            txtFindercontent.TextWrapping = TextWrapping.Wrap;
                            txtFindercontent.IsHitTestVisible = true;
                            //txtFindercontent.LostFocus += txtcontent_LostFocus;
                            txtFindercontent.Name = "fndDescription" + count.ToString();
                            txtFindercontent.Tag = field.MaxValue + "," + field.FieldDescLoc + "," + field.IsRequired + "," + count + "," + blockindex + "," + field.FieldID + "," + field.ColumnName + "," + field.FieldCode;
                            txtFindercontent.GotFocus += txtFindercontent_GotFocus;

                            if (field.FieldType == WFCoreLib.DataModels.Generic.FieldAttributes.DataType.dtInteger || field.FieldType == WFCoreLib.DataModels.Generic.FieldAttributes.DataType.dtDouble)
                            {
                                InputScope scope = new InputScope();
                                InputScopeName name = new InputScopeName();

                                name.NameValue = InputScopeNameValue.Number;
                                scope.Names.Add(name);

                                txtFindercontent.InputScope = scope;
                            }

PS: The Apple/iPhone textbox has a property that restricts the keyboard. i hope WP8 has one aswell

Regards

1
Sounds to me like you want a button, with its text property bound to a property on your view-model?Rowland Shaw
well basically, yes. but our app needs to look the same on all platforms, so i must use a textbox, and this is frustrating me, cause it looks weird, as soon as i click on the control the keyboard pops up for a sec then it navigates. i so badly want to use a button, but cantArrie
Why not style the button to look like a textbox then?Rowland Shaw
Can't you apply a custom style for your read-only so it looks ok? I have developed an app which does exactly what you want to do. Our TextBox is read-only and we bind the navigation to the Tap event of the textbox.robertk

1 Answers

2
votes

I think you can achieve this by a simple logic. So what you want to do is, Create a transparent button using expression blend. Place that button above your textbox. Bind the ZIndex property of your button. Whenever you navigates to the page check your text box contains any values. If yes set the ZIndex of button to move behind the TextBox. If the condition is wrong do the reverse. I think this will solve your issue.