[UWP] FormsTextBox clean up OnApplyTemplate (#11285)
* Add Packager.Load back to Loaded Event * - try size changed * Clean Up * FormsTextBox Cleanup * Simplify Reference Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
This commit is contained in:
Родитель
4b582d4d47
Коммит
4682bef762
|
@ -47,8 +47,7 @@ namespace Xamarin.Forms.Platform.UWP
|
||||||
|
|
||||||
InputScope _passwordInputScope;
|
InputScope _passwordInputScope;
|
||||||
InputScope _numericPasswordInputScope;
|
InputScope _numericPasswordInputScope;
|
||||||
Border _borderElement;
|
ScrollViewer _scrollViewer;
|
||||||
Windows.UI.Xaml.Controls.ScrollViewer _scrollViewer;
|
|
||||||
Windows.UI.Xaml.Controls.Grid _rootGrid;
|
Windows.UI.Xaml.Controls.Grid _rootGrid;
|
||||||
Windows.UI.Xaml.VisualState _DeleteButtonVisibleState;
|
Windows.UI.Xaml.VisualState _DeleteButtonVisibleState;
|
||||||
Windows.UI.Xaml.VisualStateGroup _DeleteButtonVisibleStateGroups;
|
Windows.UI.Xaml.VisualStateGroup _DeleteButtonVisibleStateGroups;
|
||||||
|
@ -157,14 +156,7 @@ namespace Xamarin.Forms.Platform.UWP
|
||||||
{
|
{
|
||||||
base.OnApplyTemplate();
|
base.OnApplyTemplate();
|
||||||
|
|
||||||
if (Device.Idiom == TargetIdiom.Phone)
|
_rootGrid = GetTemplateChild("RootGrid") as Windows.UI.Xaml.Controls.Grid;
|
||||||
{
|
|
||||||
// If we're on the phone, we need to grab this from the template
|
|
||||||
// so we can manually handle its background when focused
|
|
||||||
_borderElement = (Border)GetTemplateChild("BorderElement");
|
|
||||||
}
|
|
||||||
|
|
||||||
_rootGrid = (Windows.UI.Xaml.Controls.Grid)GetTemplateChild("RootGrid");
|
|
||||||
if (_rootGrid != null)
|
if (_rootGrid != null)
|
||||||
{
|
{
|
||||||
var stateGroups = WVisualStateManager.GetVisualStateGroups(_rootGrid).ToList();
|
var stateGroups = WVisualStateManager.GetVisualStateGroups(_rootGrid).ToList();
|
||||||
|
@ -173,7 +165,7 @@ namespace Xamarin.Forms.Platform.UWP
|
||||||
_DeleteButtonVisibleState = _DeleteButtonVisibleStateGroups.States.SingleOrDefault(s => s.Name == "ButtonVisible");
|
_DeleteButtonVisibleState = _DeleteButtonVisibleStateGroups.States.SingleOrDefault(s => s.Name == "ButtonVisible");
|
||||||
}
|
}
|
||||||
|
|
||||||
_scrollViewer= (Windows.UI.Xaml.Controls.ScrollViewer)GetTemplateChild("ContentElement");
|
_scrollViewer= GetTemplateChild("ContentElement") as ScrollViewer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnSizeChanged(object sender, SizeChangedEventArgs e)
|
void OnSizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче