windows phone 8.1 - How to disable TextBox MenuFlyout when it is in edit mode -
I am working on an app on Windows Phone.
I have the menu split for the text box when the text box is in editing mode, how can I disable menu flyout? (I.e when the user has taped on it and launched the keyboard)? And it is re-enabled when user has edited (when the keyboard is turned off)
This is my XAML code:.
& lt; Text Box X: Name = "ListItem" Holding = "OnHolding" & gt; & Lt; FlyoutBase.AttachedFlyout & gt; & Lt; MenuFlyout & gt; & Lt; MenuFlyoutItem x: Uid = "DeleteListItemMenuItem" command = "{binding menu command}" commandpamator = "{binding}" /> & Lt; / MenuFlyout & gt; & Lt; /FlyoutBase.AttachedFlyout> & Lt; / Text box & gt;
And this is the code behind me:
Private ZerosOnListItimesGolding (Object Sender, Holdered EventVerges Algos) {Text Box Text Box = Text Box Forms In the sender; If return (text box == empty); // This event has been removed several times, we do not want to show the menu twice if (args.HoldingState! = HoldingState. Starred) {Return; } // If the menu was properly connected, then we just need to call FlyoutBase.ShowAttachedFlyout (textBox) this easy way; }
what worked for me then state of paying attention before starting flyout like To check is
Private Zero TextBox_Holding (Object Sender, HoldingRoutedEventArgs e) {if (e.HoldingState == Windows.UI.Input. HoldingState.Completed) {Text box TB = Sender as text box; If (tb.FocusState == Windows.UI.Xaml.FocusState.Unfocused) {FlyoutBase.ShowAttachedFlyout (FrameworkElement)); }}}
The text box is in editing mode if it's a for Windows.UI.Xaml.FocusState.Pointer FocusState
Is code>
Comments
Post a Comment