iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello all,
I'm trying to get focus on the first field in a UXCallOut and can't seem to get it to work in MVVM. Here's the xaml snippet:
<Intersoft:UXCallOut x:Name="coWeighHS" DisableOverlay="False" PreferredPosition="Right" IsOpen="{Binding IsWeighHSCalloutOpen, Mode=TwoWay}" VerticalAlignment="Center">
<Intersoft:UXCallOut.Header>
<Intersoft:UXButton Content="Weigh" HorizontalAlignment="Center" Margin="4" Command="{Binding WeighHSCommand}"
Width="100" Background="#3FD7D7D7" GlassBackground="{x:Null}" Foreground="White" DisplayMode="ContentAndImage" Icon="/TourneyJett;component/Assets/Images/Dock/weighin.png" ImageHeight="20" ImageWidth="20">
<Intersoft:UXButton.ContentEffect>
<DropShadowEffect ShadowDepth="1"/>
</Intersoft:UXButton.ContentEffect>
</Intersoft:UXButton>
</Intersoft:UXCallOut.Header>
<StackPanel>
<StackPanel Orientation="Horizontal">
<Intersoft:FieldLabel x:Name="flCountHS" Header="Count:" HeaderPosition="Top" HeaderForeground="White" >
<Intersoft:UXNumericUpDown x:Name="nudCountHS" Width="40" Minimum="0" Maximum="5" Value="{Binding CurrentEventResultHS.ResultCount, Mode=TwoWay, NotifyOnValidationError=True}" DisplayMask="0" EditMask="0" VerticalAlignment="Center" Margin="2" />
</Intersoft:FieldLabel>
<Intersoft:FieldLabel Header="Weight:" HeaderPosition="Top" HeaderForeground="White" >
<Intersoft:UXNumericUpDown Width="80" Minimum="0" Maximum="40" Value="{Binding CurrentEventResultHS.ResultValue, Mode=TwoWay, NotifyOnValidationError=True}" DisplayMask="#0.####" EditMask="#0.####" VerticalAlignment="Center" Margin="2"/>
<Intersoft:FieldLabel Header="Penalty:" HeaderPosition="Top" HeaderForeground="White" >
<Intersoft:UXNumericUpDown Width="80" Minimum="0" Maximum="40" Value="{Binding CurrentEventResultHS.ResultPenalty, Mode=TwoWay, NotifyOnValidationError=True}" DisplayMask="#0.####" EditMask="#0.####" VerticalAlignment="Center" Margin="2"/>
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Intersoft:UXCheckBox Content="Disqualified" Margin="2" VerticalAlignment="Center" IsChecked="{Binding CurrentEventResultHS.IsDQ, Mode=TwoWay}" Foreground="White" />
<Intersoft:UXCheckBox Content="No Show" Margin="2" VerticalAlignment="Center" IsChecked="{Binding CurrentEventResultHS.IsNoShow, Mode=TwoWay}" Foreground="White" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,6,0,0">
<Intersoft:UXButton Content="OK" Command="{Binding WeighHSOKCommand}" Width="90" Height="24" VerticalAlignment="Bottom" Background="#3FD7D7D7" GlassBackground="{x:Null}" Foreground="White" DisplayMode="ContentAndImage" Icon="/TourneyJett;component/Assets/Images/Dock/tj.png" ImageHeight="20" ImageWidth="20" HorizontalContentAlignment="Left" Margin="2">
<DropShadowEffect ShadowDepth="1" />
<Intersoft:UXButton Content="Cancel" Command="{Binding WeighHSCancelCommand}" Width="90" Height="24" VerticalAlignment="Bottom" Background="#3FD7D7D7" GlassBackground="{x:Null}" Foreground="White" DisplayMode="ContentAndImage" Icon="/TourneyJett;component/Assets/Images/Dock/tj.png" ImageHeight="20" ImageWidth="20" HorizontalContentAlignment="Left" Margin="2">
</Intersoft:UXCallOut>
When the IsWeighHSCalloutOpen is true in my MVVM property, I use:
ISFocusManager.SetFocus("nudCountHS");
However, it never gains focus until I click on a control in the UXCallOut or on the UXCallOut itself. Once a control has focus, I can tab around the controls as expected but tabbing without first clicking on the callout or a control in the callout ignore the existence of the callout and tabs to other fields in the view.
Any ideas?
Thanks,
Ross
Hello Ross,
Actually you can focus directly by using Focus() method in Opened event. However, this could not work for the first time because the element has not beed rendered. Therefore, you can use Dispatcher as the workaround.
private void coWeighHS_Opened(object sender, Intersoft.Client.Framework.ISRoutedEventArgs e) { this.Dispatcher.BeginInvoke(delegate { nudCountHS.Focus(); }); }
Regards,Handy
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname