A user of one of my apps said that he was "expecting" the Enter key to move between the Textboxes. Is there a way to do that with the Windows Phone?
See you can set the TabIndex of each control but do I have to write a lot of code to capture the onKeyDown?
Just wondering if there is an easy way to add this feature.
One decent options is, by implementing logic to move between Textboxes as Custom Behavior. Like done by Mike Hole as written in his blog. With Mike's custom behavior, we can simply attach that behavior to the textbox and specify control name to move focus to upon enter key pressed :
<TextBox x:Name="txtUsername">
<i:Interaction.Behaviors>
<mh:OnEnter NextControlName="txtPassword" />
</i:Interaction.Behaviors>
</TextBox>
Related
I have used the standard picker which comes up with a box on the screen and allows me to select from a list.
But is there a native Xamarin picker that can be used just to pick numbers and populate a binder number? Something like I see on applications where a telephone keypad type thing displays with the numbers 1,2,3,4,5,6,7,8,9,0 and a backspace. This seems like a common kind of control for when a user wants to enter a number or dollar amount.
I look in the sample apps but could not find any example of this. If there is not one then is the only way to implement a series of numbers in a list ?
The kind of control I am interested in is one that when I click on an input field it opens up a box on the bottom of the screen with a number pad
Use an Entry with the Keyboard property set to Numeric
<Entry Keyboard="Numeric" />
In Keyboard Extension, in UIInputViewController, I can get notified through textDidChange(textInput: UITextInput) of any change, and use self.textDocumentProxy.documentContextBefore/AfterInput to get current text.
Problem arise when user 'select text'. The 'before' and 'after' "sees" only the part before and after selection.
Is there any way to know if user touched any of the Copy-Cut-Select in a textField (given - we don't have access to that field from Keyboard Extension)?
Something like:
if(self.textDocumentProxy.someProperty == UIDocumentProxyTextCut)
Or any other way to know which of the UITextField action (Copy/Cut/Select) did the user took?
I think we can not find out if user touched on Copy/Cut/Paste menu
Because a custom keyboard can draw only within the primary view of its
UIInputViewController object, it cannot select text. Text selection is
under the control of the app that is using the keyboard. If that app
provides an editing menu interface (such as for Cut, Copy, and Paste),
the keyboard has no access to it. A custom keyboard cannot offer
inline autocorrection controls near the insertion point.
Source: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html
P/s:
I saw self.textDocumentProxy.documentContextAfterInput is always NIL. Who know why?
How can we know where the cursor is to provide suggestion for user?
How can I implement spell check in a WP7 text boxes without using input scope of a text box
You may use the TextChanged event and process the text entered on the TextBox for spelling checks. That would be my approach. But it will slow down your typing and UI mapping. Best method is to use the inputScope and let the device do its work which you do not want. I hope my answer helps you.
After searching for a few days, i thought maby someone can help me.
I'm making a Windows form Application. And on one of my views i have a repeater with a label in there. This label is dynamicly sized. But My DataRepeater item won't adjust to the size of my label.
Has anyone a idea how to fix this?
The datarepeater i use is from the visual basic powerpacks.
If any more Infromation is needed to help me, please let me know.
Regards Stephan
It looks like DataRepeater is very limited with regards to resizing. I found this website that it looks like they got it working, but all of the items resize to the same size.
http://social.msdn.microsoft.com/forums/en-US/vbpowerpacks/thread/c93579f2-8b4c-4002-9ce2-152e2dddd10e/
Edit:
This solution is a little bit more complex, but VERY flexible:
You can use a FlowLayoutPanel:
You create an User Control for the item on the list and add a Select Property to the User Control.
You add a list of the User Controls to the FlowLayoutPanel.
When the User Control change size, it automatically adjust everything in the FlowLayoutPanel. (Disable WrapContents to prevent Horizontal Scrolling)
http://msdn.microsoft.com/en-us/library/ms171633.aspx
You can use the following in the UserControl to enable Click on the User Control to select it:
Click event for .Net (Windows Forms) user control
In the form that use the FlowLayoutPanel, you add the Click event, and then apply the Select to only that one User Control.
You can use the SetBoundsControl inside the User Control to set the size of the item.
I'm porting a windows forms program to run on Windows Phone 7.
Part of the windows program is a wizard style series of steps with Next and Prev buttons along with Save and Cancel. The screens are generates from metadata stored in a database. Some screens are optional and are only created after certain conditions are met.
My question is - how is this best implemented in WP7?
My initial idea was to use a pivot but then I read Tim Heuer's guide to Panaroma vs Pivot where he specifically states "don’t use pivot/pano for wizard-based UI".
I have a number of ideas - I could make each screen a page (not too keen on this due to back stack issues) or I could use one page with a tab control - but am up against it time wise and can't afford to waste days heading the wrong way.
Any ideas? My WP7 app is being built using MVVM via Caliburn Micro.
I could make each screen a page (not too keen on this due to back stack issues)
The Nonlinear Navigation Service may help you with the back button.
I could use one page with a tab control
I did one wizard-like app in WPF using restyled Tab control. Was a bit messy, works well though.
You need to design it first and consider a few scenarios. What happen when user clicks the back button, starts button or someone calls the user? (when app is tombstoned and user presses back button OS brings back the last page). Is the navigation very complex (decision tree)?
Make just one page with a grid with 3 grids/stack panels inside. Place them horizontally with margins 0; 480; 960. The only one internal grid can be shown at the time. You can see an example here (I made a joke for friends :P ).
I have used stack panels with composite transform.
<StackPanel Name="questionPanel" Grid.Row="0" HorizontalAlignment="Center">
<StackPanel.RenderTransform>
<CompositeTransform TranslateX="480"></CompositeTransform>
</StackPanel.RenderTransform>
with an animation
<UserControl.Resources>
<Storyboard x:Name="centerPanelIn">
<DoubleAnimation Duration="0:0:0.3" BeginTime="0:0:0.6" To="0"
Storyboard.TargetName="centerPanel"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
<DoubleAnimation.EasingFunction>
<ExponentialEase Exponent="6.0" EasingMode="EaseOut"></ExponentialEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
When user presses the button, Completed event is added.
private void Button_Click(object sender, RoutedEventArgs e)
{
centerPanelOut.Begin();
centerPanelOut.Completed += new EventHandler(centerPanelOut_Completed);
}
This approach has an advantage, because everything is on one page and animations give the nice UX. For more complex wizard consider making you own UserControl.
My initial thought is to not do this and redesign the process. Without a greater understanding of your situation and app though, it is hard to advise appropriately.
If you're in a hurry and really must do this I'd recommend using a single page and updating the view model to create the appearance of multiple pages.
Alternatively you could use a series of pages and the Non-Linear Navigation Service.
This may have issues with how it integrates with the rest of the application though.
Have you tried using grids and toggling their visibility using a back and next button on the app bar? The back button would then act as a cancel button.