[UWP] Changing IsPassword property changed InputScope (#4181)
* Update from origin (#8) * [C] VisibilityConverter Trims input (#3581) For CSS purposes, the VisibilityConverter was added, and actually replaced the `Boolean.Parse(str)` call for parsing Visibility. `Boolean.Parse()` trims input, and the converter was not, so this was a regression. This changes Trim() the input, to be fully backward compatible. - fixes #3554 * Ensure ConstructorCountId and TimeId elements are available before querying them (#3588) * For consistency with ResourceDictionary, expose the Source for a StyleSheet (#2589) This would allow previewer/designer/reloader to determine the source of a stylesheet and refresh its content when appropriate. * Revert "For consistency with ResourceDictionary, expose the Source for a StyleSheet (#2589)" This reverts commitf66a72de5b
. * Fix NRE; Ret 0 if Text null (#3594) fixes #3579 * [UWP, WPF] Fixes rendering of the main page (#2896) fixes #2704 * [Core] Ignore Shamehat target when running DesignTimeBuild (#3605) * [XamlC] Fix binding compilation fo value types (#3551) properly load valuetype arguments of generated setters, using ldarg, instead of ldarga. - fixes #3539 * Update PULL_REQUEST_TEMPLATE.md * Update PULL_REQUEST_TEMPLATE.md * [Android] Fix Label LineHeight (#3452) * fix line height android * Make UAP respect initial LineHeight * update .create-nuget.bat (#3638) * Add Null Check to GetRenderer (#3575) - fix #3563 * Fix 3562 Null Reference Exception (#3576) - fixes #3562 * Fix 3564 Null Reference Exception (#3578) - fixes #3564 * [iOS] AutomationProperty support for cells (#3313) fixes #3296 * [iOS] AutomationProperty support for cells * Add test case to AutomationProperties gallery * [UWP] Fix crash app when create navigation/tabbed page without children pages fixes #3188 (#3514) * [Android] Use height when determining ScaledScreenSize; fixes #3609 (#3641) * [C] Set binding context on Span Gestures (#3639) * [Core] Set binding context on Span Gestures * [Core] Simplify loop setting child binding context - fixes #3524 * Update PULL_REQUEST_TEMPLATE.md * [Android] remove deprecated AndroidUseLatestPlatformSdk (#3672) * [iOS] iPad ActionSheet should always have a Cancel method (#3636) * Add repro for #3049 * [iOS] iPad ActionSheet should always have a Cancel method fixes #3049 * [Android] fixes #3675 - set initial ScrollView Scroll values when RTL (#3676) * [Android] API check for Shadow properties on Button (#3617) fixes #2702 * [Android] API check for Shadow properties on Button * Fix swapped shadow values * [iOS] fixes #3525 - add epsilon for float compare (#3654) * [iOS] fixes #3525 - add epsilon for float compare and make region immutable * [ControlGallery] spread out spans to account for click slop * [ControlGallery] - adjust span slightly for android test * [Core] remove private * Fix text wrapping (#3671) fixes #3634 * [GTK] Fix navigation bar visibility updates (#3651) * Fix partially #3585 (#3592) * Make webkit-sharp.dll.config cross-platform * Update webkit-sharp.dll with missing signals bindings see: https://github.com/ylatuya/webkit-sharp/tree/fluendo * [iOS, UWP] fixes #2894 - Gestures collection changes weren't correctly propagating (#3643) * [iOS, UWP] fixes #2894 - Gestures weren't wiring up to spans in all cases * [Core] remove ChildGestureRecognizers when spans get removed * [iOS] removed incorrect return from null * Fixes #3663 (#3684) * Fix ScrollView Padding issue (#3685) * [WPF] Memory leak when you pop a TabbedPage (#3372) fixes #3267 * Fix [WPF] Memory leak when you pop a TabbedPage * Update ViewRenderer.cs * Update ViewRenderer.cs * [Android,iOS,UWP] Allow Entry CursorPosition/SelectionLength to be set in ctor (#3402) fixes #3343 fixes #3633 * Add repro for #3343 + unit tests * [Core] Disallow negative values for CursorPosition/SelectionLength * [All] CursorPosition/SelectionLength can bindin ctor & clear value fixes #3343 * typo * cleanup * [iOS] Cursor snaps to end * try/catch * [CSS] add more properties (#3466) map new CSS properties: - `color` on `IColorElement` (`ActivityIndicator`, `BoxView`), `ProgressBar` and `Switch` - `row-gap` and `column-gap` on `Grid` - `transform` and `transform-origin` on `VisualElement` - `vertical-align` on `Label` add new XF-specific CSS properties - `-xf-placeholder` and `-xf-placeholder-color` on `Editor`, `Entry`, `SearchBar` - `-xf-max-length` on `InputView` (`Editor` and `Entry`) - `-xf-bar-background-color` and `-xf-bar-text-color` on `NavigationPage` and `TabbedPage` - `-xf-orientation` on `ScrollView` and `StackLayout` - `-xf-horizontal-scroll-bar-visibility` and `-xf-vertical-scroll-bar-visibility` on `ScrollView` - `-xf-min-track-color`, `-xf-max-track-color` and `("-xf-thumb-color` on `Slider` - `-xf-spacing` on `StackLayout` This PR replaces and closes #3276 - fixes #2891 * [iOS] Specify a default size for UISearchBar width if needed (#3635) fixes #3413 fixes #2139 * [Controls] Add reproduction and test case for issue #3413 * [iOS] Don't use max value for iOS UISearchbar breaks on iOS 11.3 * [iOS] Force width value so we can renderer UISearchBar on iOS10 with infinite width * [Controls] Fix spelling and add Manual Review to the test of #3413 * [iOS] Simplify code for UISearchBar width * [iOS] Return always some width from measure the UISearchBar on IOS * [Controls] Add reproduction case for issue #2139 * [UWP] Fixed double set margins in Layouts (#3570) fixes #3398 fixes #3616 * [Android] Support multiple clipping settings in single layout (#3559) * Repro * Fix for API 18+ * [iOS] Unsubscribe CellPropertyChanged when SwitchCellRenderer is disposed (#3518) * [Controls] Add repo of issue #3408 * [iOS] Unsubscribe CellPropertyChanged when cell is disposed * [Controls] Add issue to project * [iOS] Introduce CellPropertyChange to CellTableViewCell to used by all other cell renderers * [Controls] Simplify Issue * [iOS] Remove PropertyChanged that was not used * [Controls] add check for null binding on template, add notes about issues * [Controls] added reference to Android crash * [iOS]Use existing PropertyChanged on ViewCelRenderer * [iOS] Keep the existing override so we don't break users * Update TextCellRenderer.cs * update submodule * 24H Mode (#3701) The 24h mode for the pickerdialog was not working. Version 3.1 was working fine. Here is an updated file. * [UWP] uncomment tests that are now passing for 3188 (#3723) * [UITest] Update Xamarin.UITest nuget package (#3632) * [UITests] Update Xamarin.UITest 2.2.5 * [UITests] Try fix Toolbaritems * [UITest] Update to 2.2.5-1606 * [UITests] Small Fixes and workarounds to make uitest happy * [UITests ] Add delay to 1733 for API28 * [Android] Revert bad merge (#3746) fixes #3705 * [Android, iOS] Fixes layout compression causes (#3698) fixes #3624 * [Android, iOS] Fixes layout compression causes * [iOS] improve UpdateNewElement method * Fix build error hopefully * [UWP] Fixes CollectionChanged events in ListView (#3323) * fixes #3273 * [UWP] Fixes CollectionChanged events in ListView * a wrapped collection is used only if the SourceItem is not ObservableCollection * improve uitest * fixed NRE in empty ListView * added a sortable custom renderer for UItest * minor refactoring * fixed reset of not wrapped collections * addressing comments * [UWP] remove WinRT hack * [UWP] add missing using and cleanup additional resources * [Android] Update Forms to remove API28 deprecated API (#3653) fixes #2128 fixes #3629 * [Build] Update provisioning * [Controls] Ignore deprecated Android API usage * [Android] Remove use of obsolete color usage * [Android] Remove app fragment usage * [android] Rollback changes to EntryCellRenderer * [Android] Better way to get the default color for the label text * [Android] Obsolete message for ContentPage.CreateFragment() * [ControlGallery] - create bitmap from Drawable to use for pixel location * [Android] Use textcolor resource * Update submodule * Fix tests (#3771) * [ControlGallery] Wait for element and add timing to tests * [iOS] Fix NRE on RenderPool * Add TabStop/TabIndex (#2795) * [Core, UWP, Android] support TabStop/TabIndex * removing linq * add iOS / MacOS implementation * add WPF implementation fixes UWP implementation * - addressing comments - improve test - optimizations - added previous tab direction in same tab group * addressing comments * [Android] support tabstop for pickers * - moving shared code to a static class - removed reflection * ITabStop -> changed to internal, renamed, added in to fastRenderers * Update ITabStop to be public * Fix : Binding Icon in ToolbarItem in TabbedPage doesn't refresh (#3761) fixes #3756 * [iOS] Fix NRE on ContextCell (#3714) fixes #3275 * [Controls] Add repo for issue #3275 * [iOS] Fix NRE when no gestures exist on table * [iOS] Null check outside loop * [iOS]Make sure to dispose/unhook when we are removed from UITableView. * Update submodule * [iOS] Don't double dispose ContextActionCell * WPF - Fix Width and Height measurement when GetDesiredSize (#3750) * WPF - Reset Width and Height when GetDesiredSize * Some formatting changes * Add APP directive * [WPF]Fix build * [Android Maps] Make markers available to subclasses (#3751) * Make markers available to subclasses * Fix build * Use Find instead of FirstOrDefault * [UITests] wait for element before querying for it (#3791) * [UITests] wait for element before querying for it * [Controls] generalize and better represent intended behavior * WPF - Fix Local store not persistant when restarting App (#3752) -fixes #3541 * WPF - Fix Local store not persistant when restarting App * Add UITest * [Controls] Add automated UI Test * [UITests] Isolate test 3408 * [UITest] Update Xamarin UITest packages * [UWP] implement Replace without reloading ListView (#3792) -fixes #3788 * [UWP] implement Replace without reloading ListView * [UWP] extract bindingcontext of new item for replace * [iOS] Use UIApperance default color for UISwitch (#3819) * [Controls] Set default color of UISwitch to Red * [iOS] Use default color from Apperance API * [UITests] replace awaits with more reliable WaitForElement (#3835) * [Core] Propagate BindingContext changes to TitleView (#3823) * [Core] Propagate BindingContext changes to TitleView * [Tests] Move UI test to Core Unit Test * [A] do not draw gradient for empty CornerRadius (#3786) Drawing CornerRadius (introduce by #1998) when the CornerRadii are actually 0 causes scaling artifacts on API < 25. This fixes the regression when no CornerRadius is set. Expect blurry border scaling with CornerRadius not empty and API < 25 - fixes #3781 * [Android] Fix WebView.Navigating event, make WebViewClient inheritable (#3780) * Extracted WebViewRenderer.WebClient to FormsWebViewClient, moved SendNavigating call from ShouldOverrideUrlLoading to OnPageStarted * Changed _webViewClient and GetWebViewClient() method to return base class * Changed public things to protected internal * Fix spaces to tabs indentation to match the coding style (#3745) * [Build] Fix merge * Fix #3097 swipe gesture not being handled in VisualElementTracker. (#3098) Fixes #3097 * Update from origin (#9) * [C] VisibilityConverter Trims input (#3581) For CSS purposes, the VisibilityConverter was added, and actually replaced the `Boolean.Parse(str)` call for parsing Visibility. `Boolean.Parse()` trims input, and the converter was not, so this was a regression. This changes Trim() the input, to be fully backward compatible. - fixes #3554 * Ensure ConstructorCountId and TimeId elements are available before querying them (#3588) * For consistency with ResourceDictionary, expose the Source for a StyleSheet (#2589) This would allow previewer/designer/reloader to determine the source of a stylesheet and refresh its content when appropriate. * Revert "For consistency with ResourceDictionary, expose the Source for a StyleSheet (#2589)" This reverts commitf66a72de5b
. * Fix NRE; Ret 0 if Text null (#3594) fixes #3579 * [UWP, WPF] Fixes rendering of the main page (#2896) fixes #2704 * [Core] Ignore Shamehat target when running DesignTimeBuild (#3605) * [XamlC] Fix binding compilation fo value types (#3551) properly load valuetype arguments of generated setters, using ldarg, instead of ldarga. - fixes #3539 * Update PULL_REQUEST_TEMPLATE.md * Update PULL_REQUEST_TEMPLATE.md * [Android] Fix Label LineHeight (#3452) * fix line height android * Make UAP respect initial LineHeight * update .create-nuget.bat (#3638) * Add Null Check to GetRenderer (#3575) - fix #3563 * Fix 3562 Null Reference Exception (#3576) - fixes #3562 * Fix 3564 Null Reference Exception (#3578) - fixes #3564 * [iOS] AutomationProperty support for cells (#3313) fixes #3296 * [iOS] AutomationProperty support for cells * Add test case to AutomationProperties gallery * [UWP] Fix crash app when create navigation/tabbed page without children pages fixes #3188 (#3514) * [Android] Use height when determining ScaledScreenSize; fixes #3609 (#3641) * [C] Set binding context on Span Gestures (#3639) * [Core] Set binding context on Span Gestures * [Core] Simplify loop setting child binding context - fixes #3524 * Update PULL_REQUEST_TEMPLATE.md * [Android] remove deprecated AndroidUseLatestPlatformSdk (#3672) * [iOS] iPad ActionSheet should always have a Cancel method (#3636) * Add repro for #3049 * [iOS] iPad ActionSheet should always have a Cancel method fixes #3049 * [Android] fixes #3675 - set initial ScrollView Scroll values when RTL (#3676) * [Android] API check for Shadow properties on Button (#3617) fixes #2702 * [Android] API check for Shadow properties on Button * Fix swapped shadow values * [iOS] fixes #3525 - add epsilon for float compare (#3654) * [iOS] fixes #3525 - add epsilon for float compare and make region immutable * [ControlGallery] spread out spans to account for click slop * [ControlGallery] - adjust span slightly for android test * [Core] remove private * Fix text wrapping (#3671) fixes #3634 * [GTK] Fix navigation bar visibility updates (#3651) * Fix partially #3585 (#3592) * Make webkit-sharp.dll.config cross-platform * Update webkit-sharp.dll with missing signals bindings see: https://github.com/ylatuya/webkit-sharp/tree/fluendo * [iOS, UWP] fixes #2894 - Gestures collection changes weren't correctly propagating (#3643) * [iOS, UWP] fixes #2894 - Gestures weren't wiring up to spans in all cases * [Core] remove ChildGestureRecognizers when spans get removed * [iOS] removed incorrect return from null * Fixes #3663 (#3684) * Fix ScrollView Padding issue (#3685) * [WPF] Memory leak when you pop a TabbedPage (#3372) fixes #3267 * Fix [WPF] Memory leak when you pop a TabbedPage * Update ViewRenderer.cs * Update ViewRenderer.cs * [Android,iOS,UWP] Allow Entry CursorPosition/SelectionLength to be set in ctor (#3402) fixes #3343 fixes #3633 * Add repro for #3343 + unit tests * [Core] Disallow negative values for CursorPosition/SelectionLength * [All] CursorPosition/SelectionLength can bindin ctor & clear value fixes #3343 * typo * cleanup * [iOS] Cursor snaps to end * try/catch * [CSS] add more properties (#3466) map new CSS properties: - `color` on `IColorElement` (`ActivityIndicator`, `BoxView`), `ProgressBar` and `Switch` - `row-gap` and `column-gap` on `Grid` - `transform` and `transform-origin` on `VisualElement` - `vertical-align` on `Label` add new XF-specific CSS properties - `-xf-placeholder` and `-xf-placeholder-color` on `Editor`, `Entry`, `SearchBar` - `-xf-max-length` on `InputView` (`Editor` and `Entry`) - `-xf-bar-background-color` and `-xf-bar-text-color` on `NavigationPage` and `TabbedPage` - `-xf-orientation` on `ScrollView` and `StackLayout` - `-xf-horizontal-scroll-bar-visibility` and `-xf-vertical-scroll-bar-visibility` on `ScrollView` - `-xf-min-track-color`, `-xf-max-track-color` and `("-xf-thumb-color` on `Slider` - `-xf-spacing` on `StackLayout` This PR replaces and closes #3276 - fixes #2891 * [iOS] Specify a default size for UISearchBar width if needed (#3635) fixes #3413 fixes #2139 * [Controls] Add reproduction and test case for issue #3413 * [iOS] Don't use max value for iOS UISearchbar breaks on iOS 11.3 * [iOS] Force width value so we can renderer UISearchBar on iOS10 with infinite width * [Controls] Fix spelling and add Manual Review to the test of #3413 * [iOS] Simplify code for UISearchBar width * [iOS] Return always some width from measure the UISearchBar on IOS * [Controls] Add reproduction case for issue #2139 * [UWP] Fixed double set margins in Layouts (#3570) fixes #3398 fixes #3616 * [Android] Support multiple clipping settings in single layout (#3559) * Repro * Fix for API 18+ * [iOS] Unsubscribe CellPropertyChanged when SwitchCellRenderer is disposed (#3518) * [Controls] Add repo of issue #3408 * [iOS] Unsubscribe CellPropertyChanged when cell is disposed * [Controls] Add issue to project * [iOS] Introduce CellPropertyChange to CellTableViewCell to used by all other cell renderers * [Controls] Simplify Issue * [iOS] Remove PropertyChanged that was not used * [Controls] add check for null binding on template, add notes about issues * [Controls] added reference to Android crash * [iOS]Use existing PropertyChanged on ViewCelRenderer * [iOS] Keep the existing override so we don't break users * Update TextCellRenderer.cs * update submodule * 24H Mode (#3701) The 24h mode for the pickerdialog was not working. Version 3.1 was working fine. Here is an updated file. * [UWP] uncomment tests that are now passing for 3188 (#3723) * [UITest] Update Xamarin.UITest nuget package (#3632) * [UITests] Update Xamarin.UITest 2.2.5 * [UITests] Try fix Toolbaritems * [UITest] Update to 2.2.5-1606 * [UITests] Small Fixes and workarounds to make uitest happy * [UITests ] Add delay to 1733 for API28 * [Android] Revert bad merge (#3746) fixes #3705 * [Android, iOS] Fixes layout compression causes (#3698) fixes #3624 * [Android, iOS] Fixes layout compression causes * [iOS] improve UpdateNewElement method * Fix build error hopefully * [UWP] Fixes CollectionChanged events in ListView (#3323) * fixes #3273 * [UWP] Fixes CollectionChanged events in ListView * a wrapped collection is used only if the SourceItem is not ObservableCollection * improve uitest * fixed NRE in empty ListView * added a sortable custom renderer for UItest * minor refactoring * fixed reset of not wrapped collections * addressing comments * [UWP] remove WinRT hack * [UWP] add missing using and cleanup additional resources * [Android] Update Forms to remove API28 deprecated API (#3653) fixes #2128 fixes #3629 * [Build] Update provisioning * [Controls] Ignore deprecated Android API usage * [Android] Remove use of obsolete color usage * [Android] Remove app fragment usage * [android] Rollback changes to EntryCellRenderer * [Android] Better way to get the default color for the label text * [Android] Obsolete message for ContentPage.CreateFragment() * [ControlGallery] - create bitmap from Drawable to use for pixel location * [Android] Use textcolor resource * Update submodule * Fix tests (#3771) * [ControlGallery] Wait for element and add timing to tests * [iOS] Fix NRE on RenderPool * Add TabStop/TabIndex (#2795) * [Core, UWP, Android] support TabStop/TabIndex * removing linq * add iOS / MacOS implementation * add WPF implementation fixes UWP implementation * - addressing comments - improve test - optimizations - added previous tab direction in same tab group * addressing comments * [Android] support tabstop for pickers * - moving shared code to a static class - removed reflection * ITabStop -> changed to internal, renamed, added in to fastRenderers * Update ITabStop to be public * Fix : Binding Icon in ToolbarItem in TabbedPage doesn't refresh (#3761) fixes #3756 * [iOS] Fix NRE on ContextCell (#3714) fixes #3275 * [Controls] Add repo for issue #3275 * [iOS] Fix NRE when no gestures exist on table * [iOS] Null check outside loop * [iOS]Make sure to dispose/unhook when we are removed from UITableView. * Update submodule * [iOS] Don't double dispose ContextActionCell * WPF - Fix Width and Height measurement when GetDesiredSize (#3750) * WPF - Reset Width and Height when GetDesiredSize * Some formatting changes * Add APP directive * [WPF]Fix build * [Android Maps] Make markers available to subclasses (#3751) * Make markers available to subclasses * Fix build * Use Find instead of FirstOrDefault * [UITests] wait for element before querying for it (#3791) * [UITests] wait for element before querying for it * [Controls] generalize and better represent intended behavior * WPF - Fix Local store not persistant when restarting App (#3752) -fixes #3541 * WPF - Fix Local store not persistant when restarting App * Add UITest * [Controls] Add automated UI Test * [UITests] Isolate test 3408 * [UITest] Update Xamarin UITest packages * [UWP] implement Replace without reloading ListView (#3792) -fixes #3788 * [UWP] implement Replace without reloading ListView * [UWP] extract bindingcontext of new item for replace * [iOS] Use UIApperance default color for UISwitch (#3819) * [Controls] Set default color of UISwitch to Red * [iOS] Use default color from Apperance API * [UITests] replace awaits with more reliable WaitForElement (#3835) * [Core] Propagate BindingContext changes to TitleView (#3823) * [Core] Propagate BindingContext changes to TitleView * [Tests] Move UI test to Core Unit Test * [A] do not draw gradient for empty CornerRadius (#3786) Drawing CornerRadius (introduce by #1998) when the CornerRadii are actually 0 causes scaling artifacts on API < 25. This fixes the regression when no CornerRadius is set. Expect blurry border scaling with CornerRadius not empty and API < 25 - fixes #3781 * [Android] Fix WebView.Navigating event, make WebViewClient inheritable (#3780) * Extracted WebViewRenderer.WebClient to FormsWebViewClient, moved SendNavigating call from ShouldOverrideUrlLoading to OnPageStarted * Changed _webViewClient and GetWebViewClient() method to return base class * Changed public things to protected internal * Fix spaces to tabs indentation to match the coding style (#3745) * [Build] Fix merge * Fix #3097 swipe gesture not being handled in VisualElementTracker. (#3098) Fixes #3097 * Ensure that the ListViewAdapter is no longer being used by the ListVi… (#3848) fixes #3603 * Ensure that the ListViewAdapter is no longer being used by the ListView before disposing it * Remove `RemoveAllViews` from `Dispose` * Removed touching the InputScope for the IsPassword property * Put back prediction settings * When InputScope was originally numeric, switch to numeric password scope, else we leave the previous logic in place * Fixed small error and added reproduction to gallery app * Fixed issues
This commit is contained in:
Родитель
27e0b8e01c
Коммит
b5ccc254eb
|
@ -66,6 +66,26 @@ namespace Xamarin.Forms.Controls
|
|||
|
||||
var maxLengthContainer = new ViewContainer<Entry>(Test.Entry.MaxLength, new Entry { MaxLength = 3 });
|
||||
|
||||
var isPasswordInputScopeContainer = new ViewContainer<Entry>(Test.Entry.IsPasswordNumeric, new Entry { Keyboard = Keyboard.Numeric });
|
||||
var switchPasswordButton = new Button
|
||||
{
|
||||
Text = "Toggle IsPassword"
|
||||
};
|
||||
var switchNumericButton = new Button
|
||||
{
|
||||
Text = "Toggle numeric"
|
||||
};
|
||||
switchPasswordButton.Clicked += (o, a) =>
|
||||
{
|
||||
isPasswordInputScopeContainer.View.IsPassword = !isPasswordInputScopeContainer.View.IsPassword;
|
||||
};
|
||||
switchNumericButton.Clicked += (o, a) =>
|
||||
{
|
||||
isPasswordInputScopeContainer.View.Keyboard = isPasswordInputScopeContainer.View.Keyboard == Keyboard.Numeric ? Keyboard.Default : Keyboard.Numeric;
|
||||
};
|
||||
isPasswordInputScopeContainer.ContainerLayout.Children.Add(switchPasswordButton);
|
||||
isPasswordInputScopeContainer.ContainerLayout.Children.Add(switchNumericButton);
|
||||
|
||||
Add (isPasswordContainer);
|
||||
Add (completedContainer);
|
||||
Add (placeholderContainer);
|
||||
|
@ -90,6 +110,7 @@ namespace Xamarin.Forms.Controls
|
|||
Add (placeholderColorDisabledContainer);
|
||||
Add (passwordColorContainer);
|
||||
Add (maxLengthContainer);
|
||||
Add (isPasswordInputScopeContainer);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -529,7 +529,8 @@ namespace Xamarin.Forms.CustomAttributes
|
|||
TextDisabledColor,
|
||||
PlaceholderDisabledColor,
|
||||
PasswordColor,
|
||||
MaxLength
|
||||
MaxLength,
|
||||
IsPasswordNumeric
|
||||
}
|
||||
|
||||
public enum Frame
|
||||
|
|
|
@ -56,12 +56,12 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
UpdatePlaceholder();
|
||||
UpdateTextColor();
|
||||
UpdateFont();
|
||||
UpdateInputScope();
|
||||
UpdateAlignment();
|
||||
UpdatePlaceholderColor();
|
||||
UpdateMaxLength();
|
||||
UpdateDetectReadingOrderFromContent();
|
||||
UpdateReturnType();
|
||||
UpdateInputScope();
|
||||
|
||||
if (_cursorPositionChangePending)
|
||||
UpdateCursorPosition();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.System;
|
||||
|
@ -19,29 +20,30 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
{
|
||||
const char ObfuscationCharacter = '●';
|
||||
|
||||
public static readonly DependencyProperty PlaceholderForegroundBrushProperty =
|
||||
public static readonly DependencyProperty PlaceholderForegroundBrushProperty =
|
||||
DependencyProperty.Register(nameof(PlaceholderForegroundBrush), typeof(Brush), typeof(FormsTextBox),
|
||||
new PropertyMetadata(default(Brush), FocusPropertyChanged));
|
||||
|
||||
public static readonly DependencyProperty PlaceholderForegroundFocusBrushProperty =
|
||||
public static readonly DependencyProperty PlaceholderForegroundFocusBrushProperty =
|
||||
DependencyProperty.Register(nameof(PlaceholderForegroundFocusBrush), typeof(Brush), typeof(FormsTextBox),
|
||||
new PropertyMetadata(default(Brush), FocusPropertyChanged));
|
||||
|
||||
public static readonly DependencyProperty ForegroundFocusBrushProperty =
|
||||
DependencyProperty.Register(nameof(ForegroundFocusBrush), typeof(Brush), typeof(FormsTextBox),
|
||||
public static readonly DependencyProperty ForegroundFocusBrushProperty =
|
||||
DependencyProperty.Register(nameof(ForegroundFocusBrush), typeof(Brush), typeof(FormsTextBox),
|
||||
new PropertyMetadata(default(Brush), FocusPropertyChanged));
|
||||
|
||||
public static readonly DependencyProperty BackgroundFocusBrushProperty =
|
||||
DependencyProperty.Register(nameof(BackgroundFocusBrush), typeof(Brush), typeof(FormsTextBox),
|
||||
public static readonly DependencyProperty BackgroundFocusBrushProperty =
|
||||
DependencyProperty.Register(nameof(BackgroundFocusBrush), typeof(Brush), typeof(FormsTextBox),
|
||||
new PropertyMetadata(default(Brush), FocusPropertyChanged));
|
||||
|
||||
public static readonly DependencyProperty IsPasswordProperty = DependencyProperty.Register(nameof(IsPassword),
|
||||
public static readonly DependencyProperty IsPasswordProperty = DependencyProperty.Register(nameof(IsPassword),
|
||||
typeof(bool), typeof(FormsTextBox), new PropertyMetadata(default(bool), OnIsPasswordChanged));
|
||||
|
||||
public new static readonly DependencyProperty TextProperty = DependencyProperty.Register(nameof(Text),
|
||||
public new static readonly DependencyProperty TextProperty = DependencyProperty.Register(nameof(Text),
|
||||
typeof(string), typeof(FormsTextBox), new PropertyMetadata("", TextPropertyChanged));
|
||||
|
||||
InputScope _passwordInputScope;
|
||||
InputScope _numericPasswordInputScope;
|
||||
Border _borderElement;
|
||||
InputScope _cachedInputScope;
|
||||
bool _cachedPredictionsSetting;
|
||||
|
@ -117,6 +119,23 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
}
|
||||
}
|
||||
|
||||
InputScope NumericPasswordInputScope
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_numericPasswordInputScope != null)
|
||||
{
|
||||
return _numericPasswordInputScope;
|
||||
}
|
||||
|
||||
_numericPasswordInputScope = new InputScope();
|
||||
var name = new InputScopeName { NameValue = InputScopeNameValue.NumericPassword };
|
||||
_numericPasswordInputScope.Names.Add(name);
|
||||
|
||||
return _numericPasswordInputScope;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
@ -340,7 +359,16 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
_cachedInputScope = InputScope;
|
||||
_cachedSpellCheckSetting = IsSpellCheckEnabled;
|
||||
_cachedPredictionsSetting = IsTextPredictionEnabled;
|
||||
InputScope = PasswordInputScope; // Change to default input scope so we don't have suggestions, etc.
|
||||
|
||||
if (InputScope != null && InputScope.Names.Any(i => i.NameValue == InputScopeNameValue.Number))
|
||||
{
|
||||
InputScope = NumericPasswordInputScope;
|
||||
}
|
||||
else
|
||||
{
|
||||
InputScope = PasswordInputScope; // Change to default input scope so we don't have suggestions, etc.
|
||||
}
|
||||
|
||||
IsTextPredictionEnabled = false; // Force the other text modification options off
|
||||
IsSpellCheckEnabled = false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче