Merge remote-tracking branch 'origin/main' into dev/merge-main-into-net8

This commit is contained in:
Matthew Leibowitz 2023-07-13 16:55:00 +02:00
Родитель 15061214f1 cda3eb3381
Коммит cb47203928
148 изменённых файлов: 3455 добавлений и 1174 удалений

29
.github/dependabot.yml поставляемый
Просмотреть файл

@ -5,6 +5,35 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 25
groups:
AndroidX:
patterns:
- "Xamarin.AndroidX.*"
- "Xamarin.Build.Download"
- "Xamarin.Google.Android.Material"
- "Xamarin.Google.Crypto.Tink.Android"
AspNetCore:
patterns:
- "Microsoft.AspNetCore.*"
- "Microsoft.JSInterop"
SkiaSharp:
patterns:
- "SkiaSharp.*"
- "Svg.*"
- "ShimSkiaSharp"
- "Fizzler"
MicrosoftExtensions:
patterns:
- "Microsoft.Extensions.*"
WindowsAppSDK:
patterns:
- "Microsoft.Graphics.Win2D"
- "Microsoft.Windows.SDK.BuildTools"
- "Microsoft.WindowsAppSDK"
xunit:
patterns:
- "xunit"
- "xunit.runner.*"
ignore:
- dependency-name: "MicrosoftMauiGraphicsVersion" # maestro
- dependency-name: "Microsoft.Maui.Graphics*" # maestro

Просмотреть файл

@ -159,6 +159,7 @@
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
<LicenseFile>$(MSBuildThisFileDirectory)LICENSE.TXT</LicenseFile>
<PackageThirdPartyNoticesFile>$(MSBuildThisFileDirectory)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
<ContinuousIntegrationBuild Condition=" '$(CI)' == 'true' ">true</ContinuousIntegrationBuild>
</PropertyGroup>
<!-- This target is replaced by GitInfo when restored. Allows Versions.targets to rely on it before restore. -->
<Target Name="GitVersion" />

Просмотреть файл

@ -1,5 +1,5 @@
<Project>
<ItemGroup >
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
</Project>

Просмотреть файл

@ -18,7 +18,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="Xam.Plugin.DeviceInfo" Version="4.1.1" />
<PackageReference Include="Xamarin.UITest" Version="4.2.0" />
<PackageReference Include="Xamarin.UITest" Version="4.1.4" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
</ItemGroup>

Просмотреть файл

@ -23,7 +23,7 @@
<PackageReference Include="Selenium.Support" Version="4.1.1" />
<PackageReference Include="Selenium.WebDriver" Version="4.1.1" />
<PackageReference Include="Xam.Plugin.DeviceInfo" Version="4.1.1" />
<PackageReference Include="Xamarin.UITest" Version="4.2.0" />
<PackageReference Include="Xamarin.UITest" Version="4.1.4" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
</ItemGroup>

Просмотреть файл

@ -18,7 +18,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="Xam.Plugin.DeviceInfo" Version="4.1.1" />
<PackageReference Include="Xamarin.UITest" Version="4.2.0" />
<PackageReference Include="Xamarin.UITest" Version="4.1.4" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
</ItemGroup>

Просмотреть файл

@ -97,46 +97,6 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsSpellCheckEnabled">
<MemberSignature Language="C#" Value="public bool IsSpellCheckEnabled { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsSpellCheckEnabled" />
<MemberSignature Language="DocId" Value="P:Microsoft.Maui.Controls.InputView.IsSpellCheckEnabled" />
<MemberSignature Language="F#" Value="member this.IsSpellCheckEnabled : bool with get, set" Usage="Microsoft.Maui.Controls.InputView.IsSpellCheckEnabled" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Maui.Controls.Core</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that controls whether spell checking is enabled.</summary>
<value>
<see langword="true" /> if spell checking is enabled. Otherwise <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsSpellCheckEnabledProperty">
<MemberSignature Language="C#" Value="public static readonly Microsoft.Maui.Controls.BindableProperty IsSpellCheckEnabledProperty;" />
<MemberSignature Language="ILAsm" Value=".field public static initonly class Microsoft.Maui.Controls.BindableProperty IsSpellCheckEnabledProperty" />
<MemberSignature Language="DocId" Value="F:Microsoft.Maui.Controls.InputView.IsSpellCheckEnabledProperty" />
<MemberSignature Language="F#" Value=" staticval mutable IsSpellCheckEnabledProperty : Microsoft.Maui.Controls.BindableProperty" Usage="Microsoft.Maui.Controls.InputView.IsSpellCheckEnabledProperty" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Maui.Controls.Core</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Maui.Controls.BindableProperty</ReturnType>
</ReturnValue>
<Docs>
<summary>Backing store for the <see cref="P:Microsoft.Maui.Controls.InputView.IsSpellCheckEnabled" /> property.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Keyboard">
<MemberSignature Language="C#" Value="public Microsoft.Maui.Keyboard Keyboard { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.Maui.Keyboard Keyboard" />

Просмотреть файл

@ -54,6 +54,34 @@
<Editor
IsReadOnly="True"
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eget tempus lorem. Sed vitae elit nisi. Donec quis quam sed mi lobortis suscipit vel quis augue. Phasellus risus enim, venenatis id blandit non, vehicula nec dui. Quisque luctus nisi vel ex imperdiet, eget molestie nisl cursus. Cras posuere vulputate lectus, ut sodales augue consequat vel." />
<Label
Text="SpellCheck (True), TextPrediction (True)"
Style="{StaticResource Headline}" />
<Editor
Text="Whats new"
IsSpellCheckEnabled="True"
IsTextPredictionEnabled="True"/>
<Label
Text="SpellCheck (False), TextPrediction (True)"
Style="{StaticResource Headline}" />
<Editor
Text="Whats new"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="True"/>
<Label
Text="SpellCheck (True), TextPrediction (False)"
Style="{StaticResource Headline}" />
<Editor
Text="Whats new"
IsSpellCheckEnabled="True"
IsTextPredictionEnabled="False"/>
<Label
Text="SpellCheck (False), TextPrediction (False)"
Style="{StaticResource Headline}" />
<Editor
Text="Whats new"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="False"/>
<Label
Text="Focus"
Style="{StaticResource Headline}" />

Просмотреть файл

@ -114,6 +114,34 @@
<Entry
Text="I am read only"
IsReadOnly="True"/>
<Label
Text="SpellCheck (True), TextPrediction (True)"
Style="{StaticResource Headline}" />
<Entry
Text="Whats new"
IsSpellCheckEnabled="True"
IsTextPredictionEnabled="True"/>
<Label
Text="SpellCheck (False), TextPrediction (True)"
Style="{StaticResource Headline}" />
<Entry
Text="Whats new"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="True"/>
<Label
Text="SpellCheck (True), TextPrediction (False)"
Style="{StaticResource Headline}" />
<Entry
Text="Whats new"
IsSpellCheckEnabled="True"
IsTextPredictionEnabled="False"/>
<Label
Text="SpellCheck (False), TextPrediction (False)"
Style="{StaticResource Headline}" />
<Entry
Text="Whats new"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="False"/>
<Label
Text="Return Command"
Style="{StaticResource Headline}" />

Просмотреть файл

@ -64,14 +64,32 @@
Text="at the bottom"
HeightRequest="100"/>
<Label
Text="IsTextPredictionEnabled=True"
Style="{StaticResource Headline}"/>
<SearchBar
Text="SpellCheck (True), TextPrediction (True)"
Style="{StaticResource Headline}" />
<SearchBar
Text="Whats new"
IsSpellCheckEnabled="True"
IsTextPredictionEnabled="True"/>
<Label
Text="IsTextPredictionEnabled=False"
Style="{StaticResource Headline}"/>
<SearchBar
Text="SpellCheck (False), TextPrediction (True)"
Style="{StaticResource Headline}" />
<SearchBar
Text="Whats new"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="True"/>
<Label
Text="SpellCheck (True), TextPrediction (False)"
Style="{StaticResource Headline}" />
<SearchBar
Text="Whats new"
IsSpellCheckEnabled="True"
IsTextPredictionEnabled="False"/>
<Label
Text="SpellCheck (False), TextPrediction (False)"
Style="{StaticResource Headline}" />
<SearchBar
Text="Whats new"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="False"/>
<Label
Text="Focus"

Просмотреть файл

@ -3,70 +3,100 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Pages.InputTransparentPage">
<ContentPage.Resources>
<ResourceDictionary>
<ContentPage.Resources>
<ResourceDictionary>
<Style TargetType="Label">
</Style>
<Style TargetType="Button">
<!-- <Setter Property="Padding" Value="14,10" /> -->
<!-- <Setter Property="WidthRequest" Value="200"/> -->
<!-- <Setter Property="WidthRequest" Value="200"/> -->
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<ScrollView>
<VerticalStackLayout>
<Label Text="This Button has InputTransparent=false; it should be clickable."/>
<Button Text="Clickable" Clicked="ClickSuccess" HorizontalOptions="Center" />
<Label Margin="0,10,0,0" Text="This Button has InputTransparent=true; it should not be clickable."/>
<Button InputTransparent="True" Text="Not Clickable" Clicked="ClickFail" HorizontalOptions="Center" />
<Grid Margin="0,10,0,0" RowDefinitions="Auto, Auto">
<Label Text="This Button has InputTransparent=true; it should not be clickable. But the button hidden under it should be."/>
<Button Grid.Row="1" Margin="2,2,0,0" InputTransparent="False" Text="Clickable" Clicked="ClickSuccess"
HorizontalOptions="Center" />
<Button BackgroundColor="LightBlue" Grid.Row="1" InputTransparent="True" Text="Not Clickable" Clicked="ClickFail"
HorizontalOptions="Center"/>
</Grid>
<Label Margin="0,10,0,0" Text="The Grid below has controls and an overlay layer with more controls."/>
<Grid>
<Grid Margin="10" HeightRequest="100" BackgroundColor="LightBlue">
<Button Text="Bottom Layer" Clicked="ClickSuccess" HorizontalOptions="Center" VerticalOptions="Center" />
</Grid>
<Grid HorizontalOptions="Fill" VerticalOptions="Fill" InputTransparent="True" CascadeInputTransparent="False">
<Button Text="Overlay BR" Clicked="ClickSuccess" HorizontalOptions="End" VerticalOptions="End" Margin="5" />
<Button Text="Overlay TL" Clicked="ClickSuccess" HorizontalOptions="Start" VerticalOptions="Start" Margin="5" />
</Grid>
</Grid>
<Label Margin="0,10,0,0" Text="The Grid below has controls an overlay with CascadeInputTransparent set to true; the overlay buttons should not be usable."/>
<Grid>
<Grid Margin="10" HeightRequest="100" BackgroundColor="LightBlue">
<Button Text="Bottom Layer" Clicked="ClickSuccess" HorizontalOptions="Center" VerticalOptions="Center" />
</Grid>
<Grid HorizontalOptions="Fill" VerticalOptions="Fill" InputTransparent="True" CascadeInputTransparent="True">
<Button Text="Overlay BR" Clicked="ClickFail" HorizontalOptions="End" VerticalOptions="End" Margin="5" />
<Button Text="Overlay TL" Clicked="ClickFail" HorizontalOptions="Start" VerticalOptions="Start" Margin="5" />
</Grid>
</Grid>
</VerticalStackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage.Resources>
<ScrollView>
<VerticalStackLayout>
<Label Text="This Button has InputTransparent=false; it should be clickable."/>
<Button Text="Clickable" Clicked="ClickSuccess" HorizontalOptions="Center" />
<Label Margin="0,10,0,0" Text="This Button has InputTransparent=true; it should not be clickable."/>
<Button InputTransparent="True" Text="Not Clickable" Clicked="ClickFail" HorizontalOptions="Center" />
<Label Margin="0,10,0,0" Text="This Button has InputTransparent=true; it should not be clickable. But the button hidden under it should be."/>
<Grid RowDefinitions="Auto" ColumnDefinitions="Auto">
<Button InputTransparent="False" Text="Clickable" Clicked="ClickSuccess" Grid.Row="1" Margin="2,2,0,0" HorizontalOptions="Center" />
<Button InputTransparent="True" Text="Not Clickable" Clicked="ClickFail" BackgroundColor="LightBlue" Grid.Row="1" HorizontalOptions="Center" />
</Grid>
<Label Margin="0,10,0,0" Text="The Grid below has controls and an overlay layer with more controls."/>
<Grid>
<Grid Margin="10" HeightRequest="100" BackgroundColor="LightBlue">
<Button Text="Bottom Layer" Clicked="ClickSuccess" HorizontalOptions="Center" VerticalOptions="Center" />
</Grid>
<Grid InputTransparent="True" CascadeInputTransparent="False" HorizontalOptions="Fill" VerticalOptions="Fill">
<Button Text="Overlay BR" Clicked="ClickSuccess" HorizontalOptions="End" VerticalOptions="End" Margin="5" />
<Button Text="Overlay TL" Clicked="ClickSuccess" HorizontalOptions="Start" VerticalOptions="Start" Margin="5" />
</Grid>
</Grid>
<Label Margin="0,10,0,0" Text="The Grid below has controls an overlay with CascadeInputTransparent set to true; the overlay buttons should not be usable."/>
<Grid>
<Grid Margin="10" HeightRequest="100" BackgroundColor="LightBlue">
<Button Text="Bottom Layer" Clicked="ClickSuccess" HorizontalOptions="Center" VerticalOptions="Center" />
</Grid>
<Grid HorizontalOptions="Fill" VerticalOptions="Fill" InputTransparent="True" CascadeInputTransparent="True">
<Button Text="Overlay BR" Clicked="ClickFail" HorizontalOptions="End" VerticalOptions="End" Margin="5" />
<Button Text="Overlay TL" Clicked="ClickFail" HorizontalOptions="Start" VerticalOptions="Start" Margin="5" />
</Grid>
</Grid>
<Label Margin="0,10,0,0" Text="The Grid below has a 'Test Button' that is controlled by the switches."/>
<VerticalStackLayout>
<Grid Margin="10" HeightRequest="100" BackgroundColor="LightBlue">
<Grid x:Name="rootLayout">
<Grid x:Name="nestedLayout">
<Button x:Name="testButton" Text="Test Button" Clicked="ClickSuccess" HorizontalOptions="Center" VerticalOptions="Center" />
</Grid>
</Grid>
</Grid>
<Grid ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,2" RowDefinitions="Auto,Auto,Auto" ColumnSpacing="12" RowSpacing="6" Margin="10,0,10,0">
<!-- root -->
<Label Grid.Row="0" Grid.Column="0" Text="Root" VerticalOptions="Center" FontAttributes="Bold" />
<Label Grid.Row="0" Grid.Column="1" Text="Transparent" VerticalOptions="Center" />
<Switch Grid.Row="0" Grid.Column="2" IsToggled="{Binding InputTransparent, Source={Reference rootLayout}, Mode=OneWayToSource}" VerticalOptions="Center" />
<Label Grid.Row="0" Grid.Column="3" Text="Cascade" VerticalOptions="Center" />
<Switch Grid.Row="0" Grid.Column="4" IsToggled="{Binding CascadeInputTransparent, Source={Reference rootLayout}, Mode=OneWayToSource}" VerticalOptions="Center" />
<BoxView Grid.Row="0" Grid.Column="5" Color="Green" WidthRequest="2" HorizontalOptions="End" IsVisible="{Binding InputTransparent, Source={Reference rootLayout}, Mode=OneWay}" />
<!-- nested -->
<Label Grid.Row="1" Grid.Column="0" Text="Nested" VerticalOptions="Center" FontAttributes="Bold" />
<Label Grid.Row="1" Grid.Column="1" Text="Transparent" VerticalOptions="Center" />
<Switch Grid.Row="1" Grid.Column="2" IsToggled="{Binding InputTransparent, Source={Reference nestedLayout}, Mode=OneWayToSource}" VerticalOptions="Center" />
<Label Grid.Row="1" Grid.Column="3" Text="Cascade" VerticalOptions="Center" />
<Switch Grid.Row="1" Grid.Column="4" IsToggled="{Binding CascadeInputTransparent, Source={Reference nestedLayout}, Mode=OneWayToSource}" VerticalOptions="Center" />
<BoxView Grid.Row="1" Grid.Column="5" Color="Green" WidthRequest="2" HorizontalOptions="End" IsVisible="{Binding InputTransparent, Source={Reference nestedLayout}, Mode=OneWay}" />
<!-- button -->
<Label Grid.Row="2" Grid.Column="0" Text="Button" VerticalOptions="Center" FontAttributes="Bold" />
<Label Grid.Row="2" Grid.Column="1" Text="Transparent" VerticalOptions="Center" />
<Switch Grid.Row="2" Grid.Column="2" IsToggled="{Binding InputTransparent, Source={Reference testButton}, Mode=OneWayToSource}" VerticalOptions="Center" />
<BoxView Grid.Row="2" Grid.Column="5" Color="Green" WidthRequest="2" HorizontalOptions="End" IsVisible="{Binding InputTransparent, Source={Reference testButton}, Mode=OneWay}" />
</Grid>
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

Просмотреть файл

@ -36,8 +36,10 @@ namespace Microsoft.Maui.Controls
/// <include file="../../docs/Microsoft.Maui.Controls/Editor.xml" path="//Member[@MemberName='PlaceholderColorProperty']/Docs/*" />
public new static readonly BindableProperty PlaceholderColorProperty = InputView.PlaceholderColorProperty;
/// <summary>Bindable property for <see cref="IsTextPredictionEnabled"/>.</summary>
public static readonly BindableProperty IsTextPredictionEnabledProperty = BindableProperty.Create(nameof(IsTextPredictionEnabled), typeof(bool), typeof(Editor), true, BindingMode.Default);
/// <summary>
/// Backing store for the <see cref="InputView.IsTextPredictionEnabled"/> property.
/// </summary>
public static new readonly BindableProperty IsTextPredictionEnabledProperty = InputView.IsTextPredictionEnabledProperty;
/// <summary>Bindable property for <see cref="CursorPosition"/>.</summary>
public static readonly BindableProperty CursorPositionProperty = BindableProperty.Create(nameof(CursorPosition), typeof(int), typeof(Editor), 0, validateValue: (b, v) => (int)v >= 0);
@ -71,13 +73,6 @@ namespace Microsoft.Maui.Controls
set { SetValue(FontAttributesProperty, value); }
}
/// <include file="../../docs/Microsoft.Maui.Controls/Editor.xml" path="//Member[@MemberName='IsTextPredictionEnabled']/Docs/*" />
public bool IsTextPredictionEnabled
{
get { return (bool)GetValue(IsTextPredictionEnabledProperty); }
set { SetValue(IsTextPredictionEnabledProperty, value); }
}
public int CursorPosition
{
get { return (int)GetValue(CursorPositionProperty); }

Просмотреть файл

@ -74,16 +74,16 @@ namespace Microsoft.Maui.Controls
/// </summary>
public static readonly BindableProperty FontAttributesProperty = FontElement.FontAttributesProperty;
/// <summary>
/// Backing store for the <see cref="InputView.IsTextPredictionEnabled"/> property.
/// </summary>
public static new readonly BindableProperty IsTextPredictionEnabledProperty = InputView.IsTextPredictionEnabledProperty;
/// <summary>
/// Backing store for the <see cref="ReturnType"/> property.
/// </summary>
public static readonly BindableProperty FontAutoScalingEnabledProperty = FontElement.FontAutoScalingEnabledProperty;
/// <summary>
/// Backing store for the <see cref="IsTextPredictionEnabled"/> property.
/// </summary>
public static readonly BindableProperty IsTextPredictionEnabledProperty = BindableProperty.Create(nameof(IsTextPredictionEnabled), typeof(bool), typeof(Entry), true, BindingMode.OneTime);
/// <summary>
/// Backing store for the <see cref="CursorPosition"/> property.
/// </summary>
@ -179,15 +179,6 @@ namespace Microsoft.Maui.Controls
set => SetValue(FontAutoScalingEnabledProperty, value);
}
/// <summary>
/// Determines whether text prediction and automatic text correction is enabled. Default value is <see langword="true"/>.
/// </summary>
public bool IsTextPredictionEnabled
{
get { return (bool)GetValue(IsTextPredictionEnabledProperty); }
set { SetValue(IsTextPredictionEnabledProperty, value); }
}
/// <summary>
/// Determines what the return key on the on-screen keyboard should look like. This is a bindable property.
/// </summary>

Просмотреть файл

@ -10,12 +10,12 @@ namespace Microsoft.Maui.Controls.Handlers.Items
{
public class EmptyViewAdapter : RecyclerView.Adapter
{
int _headerHeight;
double _headerHeight;
int _headerViewType;
object _headerView;
DataTemplate _headerViewTemplate;
int _footerHeight;
double _footerHeight;
int _footerViewType;
object _footerView;
DataTemplate _footerViewTemplate;
@ -301,18 +301,25 @@ namespace Microsoft.Maui.Controls.Handlers.Items
if (item == null)
return;
var sizeRequest = new SizeRequest(new Size(0, 0));
var size = Size.Zero;
if (item is View view)
sizeRequest = view.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.IncludeMargins);
if (item is IView view)
{
if (view.Handler == null)
{
TemplateHelpers.GetHandler(view as View, ItemsView.FindMauiContext());
}
size = view.Measure(double.PositiveInfinity, double.PositiveInfinity);
}
if (item is DataTemplate dataTemplate)
{
var content = dataTemplate.CreateContent() as View;
sizeRequest = content.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.IncludeMargins);
var content = dataTemplate.CreateContent() as IView;
size = content.Measure(double.PositiveInfinity, double.PositiveInfinity);
}
var itemHeight = (int)sizeRequest.Request.Height;
var itemHeight = size.Height;
if (isHeader)
_headerHeight = itemHeight;

Просмотреть файл

@ -3,7 +3,7 @@ namespace Microsoft.Maui.Controls.Handlers.Items
{
sealed internal class EmptySource : IItemsViewSource
{
public int Count => 0;
public int Count => (HasHeader? 1 : 0) + (HasFooter? 1 : 0);
public bool HasHeader { get; set; }
public bool HasFooter { get; set; }

Просмотреть файл

@ -0,0 +1,14 @@
#nullable disable
namespace Microsoft.Maui.Controls
{
// There are 2 Layout types: Controls and Compatibility
interface IInputTransparentContainerElement
{
bool InputTransparent { get; }
bool CascadeInputTransparent { get; }
Element Parent { get; }
}
}

Просмотреть файл

@ -19,6 +19,9 @@ namespace Microsoft.Maui.Controls
/// <summary>Bindable property for <see cref="IsSpellCheckEnabled"/>.</summary>
public static readonly BindableProperty IsSpellCheckEnabledProperty = BindableProperty.Create(nameof(IsSpellCheckEnabled), typeof(bool), typeof(InputView), true);
/// <summary>Bindable property for <see cref="IsTextPredictionEnabled"/>.</summary>
public static readonly BindableProperty IsTextPredictionEnabledProperty = BindableProperty.Create(nameof(IsTextPredictionEnabled), typeof(bool), typeof(InputView), true);
/// <summary>Bindable property for <see cref="MaxLength"/>.</summary>
public static readonly BindableProperty MaxLengthProperty = BindableProperty.Create(nameof(MaxLength), typeof(int), typeof(int), int.MaxValue);
@ -66,13 +69,24 @@ namespace Microsoft.Maui.Controls
set => SetValue(KeyboardProperty, value);
}
/// <include file="../../docs/Microsoft.Maui.Controls/InputView.xml" path="//Member[@MemberName='IsSpellCheckEnabled']/Docs/*" />
/// <summary>Gets or sets a value that controls whether spell checking is enabled.</summary>
/// <value><see langword = "true" /> if spell checking is enabled. Otherwise <see langword="false" />.</value>
/// <remarks>On Windows, spellchecking also turns on auto correction</remarks>
public bool IsSpellCheckEnabled
{
get => (bool)GetValue(IsSpellCheckEnabledProperty);
set => SetValue(IsSpellCheckEnabledProperty, value);
}
/// <summary>Gets or sets a value that controls whether text prediction and automatic text correction are enabled.</summary>
/// <value><see langword="true" /> if text prediction (auto correction) is enabled. Otherwise <see langword="false" />.</value>
/// <remarks>On Windows, text prediction only affects touch keyboards and only affects keyboard word suggestions.</remarks>
public bool IsTextPredictionEnabled
{
get => (bool)GetValue(IsTextPredictionEnabledProperty);
set => SetValue(IsTextPredictionEnabledProperty, value);
}
/// <include file="../../docs/Microsoft.Maui.Controls/InputView.xml" path="//Member[@MemberName='IsReadOnly']/Docs/*" />
public bool IsReadOnly
{

Просмотреть файл

@ -63,7 +63,7 @@ namespace Microsoft.Maui.Controls.Compatibility
}
}
public abstract class Layout : View, ILayout, ILayoutController, IPaddingElement, IView, IVisualTreeElement
public abstract class Layout : View, ILayout, ILayoutController, IPaddingElement, IView, IVisualTreeElement, IInputTransparentContainerElement
{
/// <summary>Bindable property for <see cref="IsClippedToBounds"/>.</summary>
public static readonly BindableProperty IsClippedToBoundsProperty =
@ -72,7 +72,8 @@ namespace Microsoft.Maui.Controls.Compatibility
/// <summary>Bindable property for <see cref="CascadeInputTransparent"/>.</summary>
public static readonly BindableProperty CascadeInputTransparentProperty =
BindableProperty.Create(nameof(CascadeInputTransparent), typeof(bool), typeof(Layout), true);
BindableProperty.Create(nameof(CascadeInputTransparent), typeof(bool), typeof(Layout), true,
propertyChanged: OnCascadeInputTransparentPropertyChanged);
/// <summary>Bindable property for <see cref="Padding"/>.</summary>
public static readonly BindableProperty PaddingProperty = PaddingElement.PaddingProperty;
@ -518,5 +519,15 @@ namespace Microsoft.Maui.Controls.Compatibility
return Frame.Size;
}
static void OnCascadeInputTransparentPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
// We only need to update if the cascade changes anything, namely when InputTransparent=true.
// When InputTransparent=false, then the cascade property has no effect.
if (bindable is Layout layout && layout.InputTransparent)
{
layout.RefreshInputTransparentProperty();
}
}
}
}

Просмотреть файл

@ -7,31 +7,8 @@ namespace Microsoft.Maui.Controls
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) =>
UpdateInputTransparent(handler, layout);
public static void MapInputTransparent(LayoutHandler handler, Layout layout) { }
public static void MapInputTransparent(ILayoutHandler handler, Layout layout) =>
UpdateInputTransparent(handler, layout);
static void MapInputTransparent(IViewHandler handler, IView layout) =>
UpdateInputTransparent(handler, layout);
static void UpdateInputTransparent(IViewHandler handler, IView layout)
{
if (handler is ILayoutHandler layoutHandler && layout is Layout controlsLayout)
{
if (layoutHandler.PlatformView is LayoutViewGroup layoutViewGroup)
{
// Handle input transparent for this view
layoutViewGroup.InputTransparent = layout.InputTransparent;
}
controlsLayout.UpdateDescendantInputTransparent();
}
else
{
ControlsVisualElementMapper.UpdateProperty(handler, layout, nameof(IView.InputTransparent));
}
}
public static void MapInputTransparent(ILayoutHandler handler, Layout layout) { }
}
}

Просмотреть файл

@ -15,8 +15,6 @@ namespace Microsoft.Maui.Controls
public static IPropertyMapper<IView, IViewHandler> ControlsLayoutMapper = new PropertyMapper<IView, IViewHandler>(ControlsVisualElementMapper)
{
[nameof(CascadeInputTransparent)] = MapInputTransparent,
[nameof(IView.InputTransparent)] = MapInputTransparent,
};
}
}

Просмотреть файл

@ -3,36 +3,8 @@ namespace Microsoft.Maui.Controls
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) =>
UpdateInputTransparent(handler, layout);
public static void MapInputTransparent(LayoutHandler handler, Layout layout) { }
public static void MapInputTransparent(ILayoutHandler handler, Layout layout) =>
UpdateInputTransparent(handler, layout);
static void MapInputTransparent(IViewHandler handler, IView layout) =>
UpdateInputTransparent(handler, layout);
static void UpdateInputTransparent(IViewHandler handler, IView view)
{
if (handler.PlatformView is not Microsoft.Maui.Platform.LayoutViewGroup platformView ||
view is not Layout layout)
{
return;
}
if (layout.CascadeInputTransparent)
{
// Sensitive property on NUI View was false, disabled all touch event including children
platformView.Sensitive = !layout.InputTransparent;
platformView.InputTransparent = false;
}
else
{
// InputTransparent property on LayoutViewGroup was false,
// Only LayoutViewGroup event was disabled but children are allowed
platformView.InputTransparent = layout.InputTransparent;
platformView.Sensitive = true;
}
}
public static void MapInputTransparent(ILayoutHandler handler, Layout layout) { }
}
}

Просмотреть файл

@ -5,26 +5,8 @@ namespace Microsoft.Maui.Controls
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) =>
UpdateInputTransparent(handler, layout);
public static void MapInputTransparent(LayoutHandler handler, Layout layout) { }
public static void MapInputTransparent(ILayoutHandler handler, Layout layout) =>
UpdateInputTransparent(handler, layout);
static void MapInputTransparent(IViewHandler handler, IView layout) =>
UpdateInputTransparent(handler, layout);
static void UpdateInputTransparent(IViewHandler handler, IView layout)
{
if (handler is ILayoutHandler layoutHandler && layout is Layout controlsLayout)
{
layoutHandler.PlatformView?.UpdateInputTransparent(layoutHandler, controlsLayout);
controlsLayout.UpdateDescendantInputTransparent();
}
else
{
ControlsVisualElementMapper.UpdateProperty(handler, layout, nameof(IView.InputTransparent));
}
}
public static void MapInputTransparent(ILayoutHandler handler, Layout layout) { }
}
}

Просмотреть файл

@ -11,7 +11,7 @@ namespace Microsoft.Maui.Controls
{
/// <include file="../../../docs/Microsoft.Maui.Controls/Layout.xml" path="Type[@FullName='Microsoft.Maui.Controls.Layout']/Docs/*" />
[ContentProperty(nameof(Children))]
public abstract partial class Layout : View, Maui.ILayout, IList<IView>, IBindableLayout, IPaddingElement, IVisualTreeElement, ISafeAreaView
public abstract partial class Layout : View, Maui.ILayout, IList<IView>, IBindableLayout, IPaddingElement, IVisualTreeElement, ISafeAreaView, IInputTransparentContainerElement
{
protected ILayoutManager _layoutManager;
@ -211,9 +211,6 @@ namespace Microsoft.Maui.Controls
{
NotifyHandler(nameof(ILayoutHandler.Add), index, view);
// Make sure CascadeInputTransparent is applied, if necessary
Handler?.UpdateValue(nameof(CascadeInputTransparent));
// Take care of the Element internal bookkeeping
if (view is Element element)
{
@ -241,9 +238,6 @@ namespace Microsoft.Maui.Controls
{
NotifyHandler(nameof(ILayoutHandler.Insert), index, view);
// Make sure CascadeInputTransparent is applied, if necessary
Handler?.UpdateValue(nameof(CascadeInputTransparent));
// Take care of the Element internal bookkeeping
if (view is Element element)
{
@ -254,9 +248,6 @@ namespace Microsoft.Maui.Controls
protected virtual void OnUpdate(int index, IView view, IView oldView)
{
NotifyHandler(nameof(ILayoutHandler.Update), index, view);
// Make sure CascadeInputTransparent is applied, if necessary
Handler?.UpdateValue(nameof(CascadeInputTransparent));
}
void NotifyHandler(string action, int index, IView view)
@ -287,7 +278,8 @@ namespace Microsoft.Maui.Controls
}
public static readonly BindableProperty CascadeInputTransparentProperty =
BindableProperty.Create(nameof(CascadeInputTransparent), typeof(bool), typeof(Layout), true);
BindableProperty.Create(nameof(CascadeInputTransparent), typeof(bool), typeof(Layout), true,
propertyChanged: OnCascadeInputTransparentPropertyChanged);
public bool CascadeInputTransparent
{
@ -295,21 +287,13 @@ namespace Microsoft.Maui.Controls
set => SetValue(CascadeInputTransparentProperty, value);
}
void UpdateDescendantInputTransparent()
static void OnCascadeInputTransparentPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
if (!InputTransparent || !CascadeInputTransparent)
// We only need to update if the cascade changes anything, namely when InputTransparent=true.
// When InputTransparent=false, then the cascade property has no effect.
if (bindable is Layout layout && layout.InputTransparent)
{
// We only need to propagate values if the layout is InputTransparent AND Cascade is true
return;
}
// Set all the child InputTransparent values to match this one
for (int n = 0; n < Count; n++)
{
if (this[n] is VisualElement visualElement)
{
visualElement.InputTransparent = true;
}
layout.RefreshInputTransparentProperty();
}
}
}

Просмотреть файл

@ -3,26 +3,8 @@ namespace Microsoft.Maui.Controls
{
public partial class Layout
{
public static void MapInputTransparent(LayoutHandler handler, Layout layout) =>
UpdateInputTransparent(handler, layout);
public static void MapInputTransparent(LayoutHandler handler, Layout layout) { }
public static void MapInputTransparent(ILayoutHandler handler, Layout layout) =>
UpdateInputTransparent(handler, layout);
static void MapInputTransparent(IViewHandler handler, IView layout) =>
UpdateInputTransparent(handler, layout);
static void UpdateInputTransparent(IViewHandler handler, IView layout)
{
if (handler is ILayoutHandler layoutHandler && layout is Layout controlsLayout)
{
layoutHandler.PlatformView?.UpdateInputTransparent(layoutHandler, controlsLayout);
controlsLayout.UpdateDescendantInputTransparent();
}
else
{
ControlsVisualElementMapper.UpdateProperty(handler, layout, nameof(IView.InputTransparent));
}
}
public static void MapInputTransparent(ILayoutHandler handler, Layout layout) { }
}
}

Просмотреть файл

@ -14,7 +14,7 @@ using Microsoft.Maui.Graphics;
namespace Microsoft.Maui.Controls
{
/// <include file="../../docs/Microsoft.Maui.Controls/Page.xml" path="Type[@FullName='Microsoft.Maui.Controls.Page']/Docs/*" />
public partial class Page : VisualElement, ILayout, IPageController, IElementConfiguration<Page>, IPaddingElement, ISafeAreaView, IView, ITitledElement, IToolbarElement
public partial class Page : VisualElement, ILayout, IPageController, IElementConfiguration<Page>, IPaddingElement, ISafeAreaView, ISafeAreaView2, IView, ITitledElement, IToolbarElement
{
/// <include file="../../docs/Microsoft.Maui.Controls/Page.xml" path="//Member[@MemberName='BusySetSignalName']/Docs/*" />
public const string BusySetSignalName = "Microsoft.Maui.Controls.BusySet";
@ -178,6 +178,14 @@ namespace Microsoft.Maui.Controls
bool ISafeAreaView.IgnoreSafeArea => !On<PlatformConfiguration.iOS>().UsingSafeArea();
Thickness ISafeAreaView2.SafeAreaInsets
{
set
{
On<PlatformConfiguration.iOS>().SetSafeAreaInsets(value);
}
}
public event EventHandler LayoutChanged;
public event EventHandler Appearing;
@ -231,7 +239,7 @@ namespace Microsoft.Maui.Controls
#pragma warning restore CS1573 // Parameter has no matching param tag in the XML comment (but other parameters do)
{
if (string.IsNullOrEmpty(cancel))
throw new ArgumentNullException("cancel");
throw new ArgumentNullException(nameof(cancel));
var args = new AlertArguments(title, message, accept, cancel);
args.FlowDirection = flowDirection;

Просмотреть файл

@ -6,16 +6,6 @@ namespace Microsoft.Maui.Controls.Platform
{
internal static class AutoSuggestBoxExtensions
{
public static void UpdateIsSpellCheckEnabled(this AutoSuggestBox platformControl, SearchBar searchBar)
{
var queryTextBox = platformControl.GetFirstDescendant<TextBox>();
if (queryTextBox == null)
return;
queryTextBox.IsSpellCheckEnabled = searchBar.OnThisPlatform().GetIsSpellCheckEnabled();
}
public static void UpdateText(this AutoSuggestBox platformControl, InputView inputView)
{
platformControl.Text = TextTransformUtilites.GetTransformedText(inputView.Text, inputView.TextTransform);

Просмотреть файл

@ -27,12 +27,15 @@ namespace Microsoft.Maui.Controls.Platform
var cursorOffset = newText.Length - oldText.Length;
int cursorPosition = hasFocus ? platformControl.GetCursorPosition(cursorOffset) : newText.Length;
if (oldText != newText && passwordBox is not null)
passwordBox.Password = newText;
else if (oldText != newText)
platformControl.Text = newText;
if (oldText != newText)
{
if (passwordBox is not null)
passwordBox.Password = newText;
else
platformControl.Text = newText;
platformControl.Select(cursorPosition, 0);
platformControl.Select(cursorPosition, 0);
}
}
}

Просмотреть файл

@ -28,48 +28,35 @@ namespace Microsoft.Maui.Controls.Platform
textField.AdjustsFontSizeToFitWidth = entry.OnThisPlatform().AdjustsFontSizeToFitWidth();
}
public static void UpdateText(this UITextView textView, InputView inputView)
public static void UpdateText(this UITextView textView, InputView inputView) =>
UpdateText(textView, inputView, textView.IsFirstResponder);
public static void UpdateText(this UITextField textField, InputView inputView) =>
UpdateText(textField, inputView, textField.IsEditing);
static void UpdateText(this IUITextInput textInput, InputView inputView, bool isEditing)
{
// Setting the text causes the cursor to be reset to the end of the UITextView.
// Setting the text causes the cursor to be reset to the end of the IUITextInput.
// So, let's set back the cursor to the last known position and calculate a new
// position if needed when the text was modified by a Converter.
var oldText = textView.Text ?? string.Empty;
var textRange = textInput.GetTextRange(textInput.BeginningOfDocument, textInput.EndOfDocument);
var oldText = textInput.TextInRange(textRange) ?? string.Empty;
var newText = TextTransformUtilites.GetTransformedText(
inputView?.Text,
textView.SecureTextEntry ? TextTransform.Default : inputView.TextTransform
textInput.GetSecureTextEntry() ? TextTransform.Default : inputView.TextTransform
);
// Re-calculate the cursor offset position if the text was modified by a Converter.
// but if the text is being set by code, let's just move the cursor to the end.
var cursorOffset = newText.Length - oldText.Length;
var cursorPosition = textView.IsFirstResponder ? textView.GetCursorPosition(cursorOffset) : newText.Length;
if (oldText != newText)
textView.Text = newText;
{
// Re-calculate the cursor offset position if the text was modified by a Converter.
// but if the text is being set by code, let's just move the cursor to the end.
var cursorOffset = newText.Length - oldText.Length;
var cursorPosition = isEditing ? textInput.GetCursorPosition(cursorOffset) : newText.Length;
textView.SetTextRange(cursorPosition, 0);
}
textInput.ReplaceText(textRange, newText);
public static void UpdateText(this UITextField textField, InputView inputView)
{
// Setting the text causes the cursor to be reset to the end of the UITextView.
// So, let's set back the cursor to the last known position and calculate a new
// position if needed when the text was modified by a Converter.
var oldText = textField.Text ?? string.Empty;
var newText = TextTransformUtilites.GetTransformedText(
inputView?.Text,
textField.SecureTextEntry ? TextTransform.Default : inputView.TextTransform
);
// Re-calculate the cursor offset position if the text was modified by a Converter.
// but if the text is being set by code, let's just move the cursor to the end.
var cursorOffset = newText.Length - oldText.Length;
var cursorPosition = textField.IsEditing ? textField.GetCursorPosition(cursorOffset) : newText.Length;
if (oldText != newText)
textField.Text = newText;
textField.SetTextRange(cursorPosition, 0);
textInput.SetTextRange(cursorPosition, 0);
}
}
public static void UpdateLineBreakMode(this UILabel platformLabel, Label label)

Просмотреть файл

@ -4880,8 +4880,6 @@ Microsoft.Maui.Controls.Editor.FontSize.get -> double
Microsoft.Maui.Controls.Editor.FontSize.set -> void
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Editor.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
Microsoft.Maui.Controls.Editor.SelectionLength.get -> int
Microsoft.Maui.Controls.Editor.SelectionLength.set -> void
@ -4927,8 +4925,6 @@ Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.get -> Microsoft.Maui.Text
Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Entry.IsPassword.get -> bool
Microsoft.Maui.Controls.Entry.IsPassword.set -> void
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Entry.ReturnType.get -> Microsoft.Maui.ReturnType
Microsoft.Maui.Controls.Entry.ReturnType.set -> void
Microsoft.Maui.Controls.Entry.SelectionLength.get -> int
@ -6494,8 +6490,6 @@ Microsoft.Maui.Controls.SearchBar.FontSize.get -> double
Microsoft.Maui.Controls.SearchBar.FontSize.set -> void
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.SearchBar.OnSearchButtonPressed() -> void
Microsoft.Maui.Controls.SearchBar.SearchBar() -> void
Microsoft.Maui.Controls.SearchBar.SearchButtonPressed -> System.EventHandler

Просмотреть файл

@ -8,6 +8,8 @@ Microsoft.Maui.Controls.IWindowCreator
Microsoft.Maui.Controls.IWindowCreator.CreateWindow(Microsoft.Maui.Controls.Application! app, Microsoft.Maui.IActivationState? activationState) -> Microsoft.Maui.Controls.Window!
Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Android.Content.Context! context, Microsoft.Maui.IPropertyMapper! mapper) -> void
Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.FrameRenderer(Android.Content.Context! context, Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper! commandMapper) -> void
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.set -> void
override Microsoft.Maui.Controls.Handlers.Items.CarouselViewAdapter<TItemsView, TItemsViewSource>.GetItemViewType(int position) -> int
override Microsoft.Maui.Controls.Handlers.Items.ItemsViewAdapter<TItemsView, TItemsViewSource>.GetItemId(int position) -> long
Microsoft.Maui.Controls.Handlers.Items.MauiRecyclerView<TItemsView, TAdapter, TItemsViewSource>.~MauiRecyclerView() -> void
@ -52,6 +54,7 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static Microsoft.Maui.Controls.Region.FromRectangles(System.Collections.Generic.IEnumerable<Microsoft.Maui.Graphics.Rect> rectangles) -> Microsoft.Maui.Controls.Region
~static readonly Microsoft.Maui.Controls.InputView.IsTextPredictionEnabledProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender>(TSender sender, string message) -> void
@ -102,4 +105,26 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object?
Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object?
~static Microsoft.Maui.Controls.GridExtensions.Add(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int left, int right, int top, int bottom) -> void
~static Microsoft.Maui.Controls.GridExtensions.AddWithSpan(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int row = 0, int column = 0, int rowSpan = 1, int columnSpan = 1) -> void
~static Microsoft.Maui.Controls.GridExtensions.AddWithSpan(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int row = 0, int column = 0, int rowSpan = 1, int columnSpan = 1) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(string! key, object! value) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(System.Collections.Generic.KeyValuePair<string!, object!> item) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Clear() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Contains(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ContainsKey(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.CopyTo(System.Collections.Generic.KeyValuePair<string!, object!>[]! array, int arrayIndex) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Count.get -> int
Microsoft.Maui.Controls.ShellNavigationQueryParameters.GetEnumerator() -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string!, object!>>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.IsReadOnly.get -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Keys.get -> System.Collections.Generic.ICollection<string!>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IDictionary<string!, object!>! dictionary) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! collection) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].get -> object!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].set -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.TryGetValue(string! key, out object! value) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Values.get -> System.Collections.Generic.ICollection<object!>!
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, bool animate, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task

Просмотреть файл

@ -3575,8 +3575,8 @@
~static readonly Microsoft.Maui.Controls.Entry.FontFamilyProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.Entry.FontSizeProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.Entry.HorizontalTextAlignmentProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.Entry.IsPasswordProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.Entry.IsTextPredictionEnabledProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.Entry.IsPasswordProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.Entry.KeyboardProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.Entry.PlaceholderColorProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.Entry.PlaceholderProperty -> Microsoft.Maui.Controls.BindableProperty
@ -4903,8 +4903,6 @@ Microsoft.Maui.Controls.Editor.FontSize.get -> double
Microsoft.Maui.Controls.Editor.FontSize.set -> void
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Editor.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
Microsoft.Maui.Controls.Editor.SelectionLength.get -> int
Microsoft.Maui.Controls.Editor.SelectionLength.set -> void
@ -4950,8 +4948,6 @@ Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.get -> Microsoft.Maui.Text
Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Entry.IsPassword.get -> bool
Microsoft.Maui.Controls.Entry.IsPassword.set -> void
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Entry.ReturnType.get -> Microsoft.Maui.ReturnType
Microsoft.Maui.Controls.Entry.ReturnType.set -> void
Microsoft.Maui.Controls.Entry.SelectionLength.get -> int
@ -6525,8 +6521,6 @@ Microsoft.Maui.Controls.SearchBar.FontSize.get -> double
Microsoft.Maui.Controls.SearchBar.FontSize.set -> void
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.SearchBar.OnSearchButtonPressed() -> void
Microsoft.Maui.Controls.SearchBar.SearchBar() -> void
Microsoft.Maui.Controls.SearchBar.SearchButtonPressed -> System.EventHandler

Просмотреть файл

@ -8,6 +8,8 @@ Microsoft.Maui.Controls.IWindowCreator
Microsoft.Maui.Controls.IWindowCreator.CreateWindow(Microsoft.Maui.Controls.Application! app, Microsoft.Maui.IActivationState? activationState) -> Microsoft.Maui.Controls.Window!
Microsoft.Maui.Controls.Handlers.Compatibility.PhoneFlyoutPageRenderer.FlyoutOverlapsDetailsInPopoverMode.get -> bool
Microsoft.Maui.Controls.Handlers.Compatibility.PhoneFlyoutPageRenderer.FlyoutOverlapsDetailsInPopoverMode.set -> void
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
Microsoft.Maui.Controls.Platform.ShapesExtensions
Microsoft.Maui.Controls.PointerGestureRecognizer.PointerEnteredCommandParameter.get -> object!
@ -67,6 +69,7 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static Microsoft.Maui.Controls.Region.FromRectangles(System.Collections.Generic.IEnumerable<Microsoft.Maui.Graphics.Rect> rectangles) -> Microsoft.Maui.Controls.Region
~static readonly Microsoft.Maui.Controls.InputView.IsTextPredictionEnabledProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender>(TSender sender, string message) -> void
@ -105,3 +108,25 @@ Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type!
*REMOVED*override Microsoft.Maui.Controls.Handlers.Compatibility.PhoneFlyoutPageRenderer.WillRotate(UIKit.UIInterfaceOrientation toInterfaceOrientation, double duration) -> void
~virtual Microsoft.Maui.Controls.Handlers.Items.ItemsViewController<TItemsView>.DetermineCellReuseId(Foundation.NSIndexPath indexPath) -> string
override Microsoft.Maui.Controls.Handlers.Items.ItemsViewHandler<TItemsView>.GetDesiredSize(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.ShellNavigationQueryParameters
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(string! key, object! value) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(System.Collections.Generic.KeyValuePair<string!, object!> item) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Clear() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Contains(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ContainsKey(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.CopyTo(System.Collections.Generic.KeyValuePair<string!, object!>[]! array, int arrayIndex) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Count.get -> int
Microsoft.Maui.Controls.ShellNavigationQueryParameters.GetEnumerator() -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string!, object!>>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.IsReadOnly.get -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Keys.get -> System.Collections.Generic.ICollection<string!>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IDictionary<string!, object!>! dictionary) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! collection) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].get -> object!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].set -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.TryGetValue(string! key, out object! value) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Values.get -> System.Collections.Generic.ICollection<object!>!
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, bool animate, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task

Просмотреть файл

@ -4903,8 +4903,6 @@ Microsoft.Maui.Controls.Editor.FontSize.get -> double
Microsoft.Maui.Controls.Editor.FontSize.set -> void
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Editor.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
Microsoft.Maui.Controls.Editor.SelectionLength.get -> int
Microsoft.Maui.Controls.Editor.SelectionLength.set -> void
@ -4950,8 +4948,6 @@ Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.get -> Microsoft.Maui.Text
Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Entry.IsPassword.get -> bool
Microsoft.Maui.Controls.Entry.IsPassword.set -> void
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Entry.ReturnType.get -> Microsoft.Maui.ReturnType
Microsoft.Maui.Controls.Entry.ReturnType.set -> void
Microsoft.Maui.Controls.Entry.SelectionLength.get -> int
@ -6525,8 +6521,6 @@ Microsoft.Maui.Controls.SearchBar.FontSize.get -> double
Microsoft.Maui.Controls.SearchBar.FontSize.set -> void
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.SearchBar.OnSearchButtonPressed() -> void
Microsoft.Maui.Controls.SearchBar.SearchBar() -> void
Microsoft.Maui.Controls.SearchBar.SearchButtonPressed -> System.EventHandler

Просмотреть файл

@ -8,6 +8,8 @@ Microsoft.Maui.Controls.IWindowCreator
Microsoft.Maui.Controls.IWindowCreator.CreateWindow(Microsoft.Maui.Controls.Application! app, Microsoft.Maui.IActivationState? activationState) -> Microsoft.Maui.Controls.Window!
Microsoft.Maui.Controls.Handlers.Compatibility.PhoneFlyoutPageRenderer.FlyoutOverlapsDetailsInPopoverMode.get -> bool
Microsoft.Maui.Controls.Handlers.Compatibility.PhoneFlyoutPageRenderer.FlyoutOverlapsDetailsInPopoverMode.set -> void
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
Microsoft.Maui.Controls.Platform.ShapesExtensions
Microsoft.Maui.Controls.PointerGestureRecognizer.PointerEnteredCommandParameter.get -> object!
@ -67,6 +69,7 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static Microsoft.Maui.Controls.Region.FromRectangles(System.Collections.Generic.IEnumerable<Microsoft.Maui.Graphics.Rect> rectangles) -> Microsoft.Maui.Controls.Region
~static readonly Microsoft.Maui.Controls.InputView.IsTextPredictionEnabledProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender>(TSender sender, string message) -> void
@ -105,3 +108,25 @@ Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type!
*REMOVED*override Microsoft.Maui.Controls.Handlers.Compatibility.PhoneFlyoutPageRenderer.WillRotate(UIKit.UIInterfaceOrientation toInterfaceOrientation, double duration) -> void
~virtual Microsoft.Maui.Controls.Handlers.Items.ItemsViewController<TItemsView>.DetermineCellReuseId(Foundation.NSIndexPath indexPath) -> string
override Microsoft.Maui.Controls.Handlers.Items.ItemsViewHandler<TItemsView>.GetDesiredSize(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.ShellNavigationQueryParameters
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(string! key, object! value) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(System.Collections.Generic.KeyValuePair<string!, object!> item) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Clear() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Contains(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ContainsKey(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.CopyTo(System.Collections.Generic.KeyValuePair<string!, object!>[]! array, int arrayIndex) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Count.get -> int
Microsoft.Maui.Controls.ShellNavigationQueryParameters.GetEnumerator() -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string!, object!>>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.IsReadOnly.get -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Keys.get -> System.Collections.Generic.ICollection<string!>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IDictionary<string!, object!>! dictionary) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! collection) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].get -> object!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].set -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.TryGetValue(string! key, out object! value) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Values.get -> System.Collections.Generic.ICollection<object!>!
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, bool animate, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task

Просмотреть файл

@ -4444,8 +4444,6 @@ Microsoft.Maui.Controls.Editor.FontSize.get -> double
Microsoft.Maui.Controls.Editor.FontSize.set -> void
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Editor.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
Microsoft.Maui.Controls.Editor.SelectionLength.get -> int
Microsoft.Maui.Controls.Editor.SelectionLength.set -> void
@ -4491,8 +4489,6 @@ Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.get -> Microsoft.Maui.Text
Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Entry.IsPassword.get -> bool
Microsoft.Maui.Controls.Entry.IsPassword.set -> void
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Entry.ReturnType.get -> Microsoft.Maui.ReturnType
Microsoft.Maui.Controls.Entry.ReturnType.set -> void
Microsoft.Maui.Controls.Entry.SelectionLength.get -> int
@ -6075,8 +6071,6 @@ Microsoft.Maui.Controls.SearchBar.FontSize.get -> double
Microsoft.Maui.Controls.SearchBar.FontSize.set -> void
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.SearchBar.OnSearchButtonPressed() -> void
Microsoft.Maui.Controls.SearchBar.SearchBar() -> void
Microsoft.Maui.Controls.SearchBar.SearchButtonPressed -> System.EventHandler

Просмотреть файл

@ -34,6 +34,8 @@ Microsoft.Maui.Controls.Platform.FormattedStringExtensions
override Microsoft.Maui.Controls.View.ChangeVisualState() -> void
Microsoft.Maui.Controls.Handlers.BoxViewHandler
Microsoft.Maui.Controls.Handlers.BoxViewHandler.BoxViewHandler() -> void
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.set -> void
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender>(TSender sender, string message) -> void
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Subscribe<TSender, TArgs>(object subscriber, string message, System.Action<TSender, TArgs> callback, TSender source = null) -> void
@ -88,3 +90,26 @@ Microsoft.Maui.Controls.Shapes.Shape.~Shape() -> void
override Microsoft.Maui.Controls.Shapes.Shape.OnBindingContextChanged() -> void
~override Microsoft.Maui.Controls.ImageButton.OnPropertyChanged(string propertyName = null) -> void
~static Microsoft.Maui.Controls.Region.FromRectangles(System.Collections.Generic.IEnumerable<Microsoft.Maui.Graphics.Rect> rectangles) -> Microsoft.Maui.Controls.Region
Microsoft.Maui.Controls.ShellNavigationQueryParameters
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(string! key, object! value) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(System.Collections.Generic.KeyValuePair<string!, object!> item) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Clear() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Contains(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ContainsKey(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.CopyTo(System.Collections.Generic.KeyValuePair<string!, object!>[]! array, int arrayIndex) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Count.get -> int
Microsoft.Maui.Controls.ShellNavigationQueryParameters.GetEnumerator() -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string!, object!>>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.IsReadOnly.get -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Keys.get -> System.Collections.Generic.ICollection<string!>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IDictionary<string!, object!>! dictionary) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! collection) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].get -> object!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].set -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.TryGetValue(string! key, out object! value) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Values.get -> System.Collections.Generic.ICollection<object!>!
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, bool animate, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~static readonly Microsoft.Maui.Controls.InputView.IsTextPredictionEnabledProperty -> Microsoft.Maui.Controls.BindableProperty

Просмотреть файл

@ -4610,8 +4610,6 @@ Microsoft.Maui.Controls.Editor.FontSize.get -> double
Microsoft.Maui.Controls.Editor.FontSize.set -> void
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Editor.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
Microsoft.Maui.Controls.Editor.SelectionLength.get -> int
Microsoft.Maui.Controls.Editor.SelectionLength.set -> void
@ -4657,8 +4655,6 @@ Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.get -> Microsoft.Maui.Text
Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Entry.IsPassword.get -> bool
Microsoft.Maui.Controls.Entry.IsPassword.set -> void
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Entry.ReturnType.get -> Microsoft.Maui.ReturnType
Microsoft.Maui.Controls.Entry.ReturnType.set -> void
Microsoft.Maui.Controls.Entry.SelectionLength.get -> int
@ -6177,8 +6173,6 @@ Microsoft.Maui.Controls.SearchBar.FontSize.get -> double
Microsoft.Maui.Controls.SearchBar.FontSize.set -> void
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.SearchBar.OnSearchButtonPressed() -> void
Microsoft.Maui.Controls.SearchBar.SearchBar() -> void
Microsoft.Maui.Controls.SearchBar.SearchButtonPressed -> System.EventHandler

Просмотреть файл

@ -4,6 +4,8 @@
~Microsoft.Maui.Controls.Accelerator.Key.get -> string
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.Border.~Border() -> void
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.IWindowCreator
Microsoft.Maui.Controls.IWindowCreator.CreateWindow(Microsoft.Maui.Controls.Application! app, Microsoft.Maui.IActivationState? activationState) -> Microsoft.Maui.Controls.Window!
Microsoft.Maui.Controls.Platform.CollectionViewExtensions
@ -15,6 +17,7 @@ Microsoft.Maui.Controls.PointerGestureRecognizer.PointerMovedCommandParameter.ge
*REMOVED*Microsoft.Maui.Controls.PointerGestureRecognizer.PointerExitedCommandParameter.get -> System.Windows.Input.ICommand!
*REMOVED*Microsoft.Maui.Controls.PointerGestureRecognizer.PointerMovedCommandParameter.get -> System.Windows.Input.ICommand!
Microsoft.Maui.Controls.Handlers.Items.StructuredItemsViewHandler<TItemsView>.~StructuredItemsViewHandler() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.TryGetValue(string! key, out object! value) -> bool
override Microsoft.Maui.Controls.Handlers.BoxViewHandler.NeedsContainer.get -> bool
Microsoft.Maui.Controls.Handlers.BoxViewHandler
Microsoft.Maui.Controls.Handlers.BoxViewHandler.BoxViewHandler() -> void
@ -68,6 +71,7 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static Microsoft.Maui.Controls.Region.FromRectangles(System.Collections.Generic.IEnumerable<Microsoft.Maui.Graphics.Rect> rectangles) -> Microsoft.Maui.Controls.Region
~static readonly Microsoft.Maui.Controls.InputView.IsTextPredictionEnabledProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender>(TSender sender, string message) -> void
@ -102,4 +106,25 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object?
Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object?
~static Microsoft.Maui.Controls.GridExtensions.Add(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int left, int right, int top, int bottom) -> void
~static Microsoft.Maui.Controls.GridExtensions.AddWithSpan(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int row = 0, int column = 0, int rowSpan = 1, int columnSpan = 1) -> void
~static Microsoft.Maui.Controls.GridExtensions.AddWithSpan(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int row = 0, int column = 0, int rowSpan = 1, int columnSpan = 1) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(string! key, object! value) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(System.Collections.Generic.KeyValuePair<string!, object!> item) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Clear() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Contains(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ContainsKey(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.CopyTo(System.Collections.Generic.KeyValuePair<string!, object!>[]! array, int arrayIndex) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Count.get -> int
Microsoft.Maui.Controls.ShellNavigationQueryParameters.GetEnumerator() -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string!, object!>>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.IsReadOnly.get -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Keys.get -> System.Collections.Generic.ICollection<string!>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IDictionary<string!, object!>! dictionary) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! collection) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].get -> object!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].set -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Values.get -> System.Collections.Generic.ICollection<object!>!
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, bool animate, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task

Просмотреть файл

@ -4412,8 +4412,6 @@ Microsoft.Maui.Controls.Editor.FontSize.get -> double
Microsoft.Maui.Controls.Editor.FontSize.set -> void
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Editor.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
Microsoft.Maui.Controls.Editor.SelectionLength.get -> int
Microsoft.Maui.Controls.Editor.SelectionLength.set -> void
@ -4459,8 +4457,6 @@ Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.get -> Microsoft.Maui.Text
Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Entry.IsPassword.get -> bool
Microsoft.Maui.Controls.Entry.IsPassword.set -> void
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Entry.ReturnType.get -> Microsoft.Maui.ReturnType
Microsoft.Maui.Controls.Entry.ReturnType.set -> void
Microsoft.Maui.Controls.Entry.SelectionLength.get -> int
@ -5821,8 +5817,6 @@ Microsoft.Maui.Controls.SearchBar.FontSize.get -> double
Microsoft.Maui.Controls.SearchBar.FontSize.set -> void
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.SearchBar.OnSearchButtonPressed() -> void
Microsoft.Maui.Controls.SearchBar.SearchBar() -> void
Microsoft.Maui.Controls.SearchBar.SearchButtonPressed -> System.EventHandler

Просмотреть файл

@ -4,6 +4,8 @@
~Microsoft.Maui.Controls.Accelerator.Key.get -> string
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.Border.~Border() -> void
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.IWindowCreator
Microsoft.Maui.Controls.IWindowCreator.CreateWindow(Microsoft.Maui.Controls.Application! app, Microsoft.Maui.IActivationState? activationState) -> Microsoft.Maui.Controls.Window!
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
@ -42,6 +44,7 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static Microsoft.Maui.Controls.Region.FromRectangles(System.Collections.Generic.IEnumerable<Microsoft.Maui.Graphics.Rect> rectangles) -> Microsoft.Maui.Controls.Region
~static readonly Microsoft.Maui.Controls.InputView.IsTextPredictionEnabledProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Send<TSender>(TSender sender, string message) -> void
@ -90,4 +93,26 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object?
Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object?
~static Microsoft.Maui.Controls.GridExtensions.Add(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int left, int right, int top, int bottom) -> void
~static Microsoft.Maui.Controls.GridExtensions.AddWithSpan(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int row = 0, int column = 0, int rowSpan = 1, int columnSpan = 1) -> void
~static Microsoft.Maui.Controls.GridExtensions.AddWithSpan(this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int row = 0, int column = 0, int rowSpan = 1, int columnSpan = 1) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(string! key, object! value) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(System.Collections.Generic.KeyValuePair<string!, object!> item) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Clear() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Contains(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ContainsKey(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.CopyTo(System.Collections.Generic.KeyValuePair<string!, object!>[]! array, int arrayIndex) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Count.get -> int
Microsoft.Maui.Controls.ShellNavigationQueryParameters.GetEnumerator() -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string!, object!>>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.IsReadOnly.get -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Keys.get -> System.Collections.Generic.ICollection<string!>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IDictionary<string!, object!>! dictionary) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! collection) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].get -> object!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].set -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.TryGetValue(string! key, out object! value) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Values.get -> System.Collections.Generic.ICollection<object!>!
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, bool animate, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task

Просмотреть файл

@ -4412,8 +4412,6 @@ Microsoft.Maui.Controls.Editor.FontSize.get -> double
Microsoft.Maui.Controls.Editor.FontSize.set -> void
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.Editor.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Editor.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Editor.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
Microsoft.Maui.Controls.Editor.SelectionLength.get -> int
Microsoft.Maui.Controls.Editor.SelectionLength.set -> void
@ -4459,8 +4457,6 @@ Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.get -> Microsoft.Maui.Text
Microsoft.Maui.Controls.Entry.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.Entry.IsPassword.get -> bool
Microsoft.Maui.Controls.Entry.IsPassword.set -> void
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.Entry.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.Entry.ReturnType.get -> Microsoft.Maui.ReturnType
Microsoft.Maui.Controls.Entry.ReturnType.set -> void
Microsoft.Maui.Controls.Entry.SelectionLength.get -> int
@ -5821,8 +5817,6 @@ Microsoft.Maui.Controls.SearchBar.FontSize.get -> double
Microsoft.Maui.Controls.SearchBar.FontSize.set -> void
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
Microsoft.Maui.Controls.SearchBar.HorizontalTextAlignment.set -> void
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.SearchBar.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.SearchBar.OnSearchButtonPressed() -> void
Microsoft.Maui.Controls.SearchBar.SearchBar() -> void
Microsoft.Maui.Controls.SearchBar.SearchButtonPressed -> System.EventHandler

Просмотреть файл

@ -4,6 +4,8 @@
~Microsoft.Maui.Controls.Accelerator.Key.get -> string
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
Microsoft.Maui.Controls.Border.~Border() -> void
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.get -> bool
Microsoft.Maui.Controls.InputView.IsTextPredictionEnabled.set -> void
Microsoft.Maui.Controls.IWindowCreator
Microsoft.Maui.Controls.IWindowCreator.CreateWindow(Microsoft.Maui.Controls.Application! app, Microsoft.Maui.IActivationState? activationState) -> Microsoft.Maui.Controls.Window!
Microsoft.Maui.Controls.LayoutOptions.Equals(Microsoft.Maui.Controls.LayoutOptions other) -> bool
@ -16,6 +18,26 @@ Microsoft.Maui.Controls.PointerGestureRecognizer.PointerMovedCommandParameter.ge
Microsoft.Maui.Controls.Region.Equals(Microsoft.Maui.Controls.Region other) -> bool
Microsoft.Maui.Controls.Shapes.Matrix.Equals(Microsoft.Maui.Controls.Shapes.Matrix other) -> bool
Microsoft.Maui.Controls.Shapes.Shape.~Shape() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(string! key, object! value) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Add(System.Collections.Generic.KeyValuePair<string!, object!> item) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Clear() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Contains(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ContainsKey(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.CopyTo(System.Collections.Generic.KeyValuePair<string!, object!>[]! array, int arrayIndex) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Count.get -> int
Microsoft.Maui.Controls.ShellNavigationQueryParameters.GetEnumerator() -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string!, object!>>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.IsReadOnly.get -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Keys.get -> System.Collections.Generic.ICollection<string!>!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(string! key) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Remove(System.Collections.Generic.KeyValuePair<string!, object!> item) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters() -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IDictionary<string!, object!>! dictionary) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.ShellNavigationQueryParameters(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object!>>! collection) -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].get -> object!
Microsoft.Maui.Controls.ShellNavigationQueryParameters.this[string! key].set -> void
Microsoft.Maui.Controls.ShellNavigationQueryParameters.TryGetValue(string! key, out object! value) -> bool
Microsoft.Maui.Controls.ShellNavigationQueryParameters.Values.get -> System.Collections.Generic.ICollection<object!>!
Microsoft.Maui.Controls.VisualElement.~VisualElement() -> void
override Microsoft.Maui.Controls.LayoutOptions.GetHashCode() -> int
override Microsoft.Maui.Controls.Region.GetHashCode() -> int
@ -43,6 +65,8 @@ Microsoft.Maui.Controls.VisualElement.RefreshIsEnabledProperty() -> void
override Microsoft.Maui.Controls.Button.IsEnabledCore.get -> bool
override Microsoft.Maui.Controls.ImageButton.IsEnabledCore.get -> bool
override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, bool animate, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~Microsoft.Maui.Controls.Shell.GoToAsync(Microsoft.Maui.Controls.ShellNavigationState state, Microsoft.Maui.Controls.ShellNavigationQueryParameters shellNavigationQueryParameters) -> System.Threading.Tasks.Task
~Microsoft.Maui.Controls.WebView.UserAgent.get -> string
~Microsoft.Maui.Controls.WebView.UserAgent.set -> void
~override Microsoft.Maui.Controls.ImageButton.OnPropertyChanged(string propertyName = null) -> void
@ -50,6 +74,7 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool
~override Microsoft.Maui.Controls.Region.Equals(object obj) -> bool
~override Microsoft.Maui.Controls.Shapes.Matrix.Equals(object obj) -> bool
~static Microsoft.Maui.Controls.Region.FromRectangles(System.Collections.Generic.IEnumerable<Microsoft.Maui.Graphics.Rect> rectangles) -> Microsoft.Maui.Controls.Region
~static readonly Microsoft.Maui.Controls.InputView.IsTextPredictionEnabledProperty -> Microsoft.Maui.Controls.BindableProperty
~static readonly Microsoft.Maui.Controls.WebView.UserAgentProperty -> Microsoft.Maui.Controls.BindableProperty
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender, TArgs>(TSender sender, string message, TArgs args) -> void
*REMOVED*~static Microsoft.Maui.Controls.MessagingCenter.Send<TSender>(TSender sender, string message) -> void

Просмотреть файл

@ -6,9 +6,7 @@ namespace Microsoft.Maui.Controls
public static IPropertyMapper<ISearchBar, SearchBarHandler> ControlsSearchBarMapper =
new PropertyMapper<SearchBar, SearchBarHandler>(SearchBarHandler.Mapper)
{
#if WINDOWS
[PlatformConfiguration.WindowsSpecific.SearchBar.IsSpellCheckEnabledProperty.PropertyName] = MapIsSpellCheckEnabled,
#elif IOS
#if IOS
[PlatformConfiguration.iOSSpecific.SearchBar.SearchBarStyleProperty.PropertyName] = MapSearchBarStyle,
#endif
[nameof(Text)] = MapText,

Просмотреть файл

@ -1,4 +1,7 @@
#nullable disable
using System;
namespace Microsoft.Maui.Controls
{
public partial class SearchBar
@ -6,12 +9,16 @@ namespace Microsoft.Maui.Controls
public static void MapText(SearchBarHandler handler, SearchBar searchBar) =>
MapText((ISearchBarHandler)handler, searchBar);
public static void MapIsSpellCheckEnabled(SearchBarHandler handler, SearchBar searchBar) =>
MapIsSpellCheckEnabled((ISearchBarHandler)handler, searchBar);
[Obsolete("Use the SearchBarHandler's mapper instead")]
public static void MapIsSpellCheckEnabled(SearchBarHandler handler, SearchBar searchBar)
{
handler.PlatformView?.UpdateIsSpellCheckEnabled(searchBar);
}
[Obsolete("Use the SearchBarHandler's mapper instead.")]
public static void MapIsSpellCheckEnabled(ISearchBarHandler handler, SearchBar searchBar)
{
Platform.AutoSuggestBoxExtensions.UpdateIsSpellCheckEnabled(handler.PlatformView, searchBar);
handler.PlatformView?.UpdateIsSpellCheckEnabled(searchBar);
}
public static void MapText(ISearchBarHandler handler, SearchBar searchBar)
@ -19,4 +26,4 @@ namespace Microsoft.Maui.Controls
Platform.AutoSuggestBoxExtensions.UpdateText(handler.PlatformView, searchBar);
}
}
}
}

Просмотреть файл

@ -41,8 +41,10 @@ namespace Microsoft.Maui.Controls
/// <summary>Bindable property for <see cref="FontAttributes"/>.</summary>
public static readonly BindableProperty FontAttributesProperty = FontElement.FontAttributesProperty;
/// <summary>Bindable property for <see cref="IsTextPredictionEnabled"/>.</summary>
public static readonly BindableProperty IsTextPredictionEnabledProperty = BindableProperty.Create(nameof(IsTextPredictionEnabled), typeof(bool), typeof(SearchBar), true, BindingMode.Default);
/// <summary>
/// Backing store for the <see cref="InputView.IsTextPredictionEnabled"/> property.
/// </summary>
public static new readonly BindableProperty IsTextPredictionEnabledProperty = InputView.IsTextPredictionEnabledProperty;
/// <summary>Bindable property for <see cref="CursorPosition"/>.</summary>
public static readonly BindableProperty CursorPositionProperty = BindableProperty.Create(nameof(CursorPosition), typeof(int), typeof(SearchBar), 0, validateValue: (b, v) => (int)v >= 0);
@ -109,12 +111,6 @@ namespace Microsoft.Maui.Controls
set { SetValue(FontAttributesProperty, value); }
}
public bool IsTextPredictionEnabled
{
get { return (bool)GetValue(IsTextPredictionEnabledProperty); }
set { SetValue(IsTextPredictionEnabledProperty, value); }
}
public int CursorPosition
{
get { return (int)GetValue(CursorPositionProperty); }

Просмотреть файл

@ -691,6 +691,29 @@ namespace Microsoft.Maui.Controls
return _navigationManager.GoToAsync(state, animate, false, parameters: new ShellRouteParameters(parameters));
}
/// <summary>
/// This method navigates to a <see cref="ShellNavigationState" /> and returns a <see cref="Task" /> that will complete once the navigation animation.
/// </summary>
/// <param name="state">Defines the path for Shell to navigate to.</param>
/// <param name="shellNavigationQueryParameters">Parameters to use for this specific navigation operation.</param>
/// <returns></returns>
public Task GoToAsync(ShellNavigationState state, ShellNavigationQueryParameters shellNavigationQueryParameters)
{
return _navigationManager.GoToAsync(state, null, false, parameters: new ShellRouteParameters(shellNavigationQueryParameters));
}
/// <summary>
/// This method navigates to a <see cref="ShellNavigationState" /> and returns a <see cref="Task" />.
/// </summary>
/// <param name="state">Defines the path for Shell to navigate to.</param>
/// <param name="animate">Indicates if your transition is animated</param>
/// <param name="shellNavigationQueryParameters">Parameters to use for this specific navigation operation.</param>
/// <returns></returns>
public Task GoToAsync(ShellNavigationState state, bool animate, ShellNavigationQueryParameters shellNavigationQueryParameters)
{
return _navigationManager.GoToAsync(state, animate, false, parameters: new ShellRouteParameters(shellNavigationQueryParameters));
}
public void AddLogicalChild(Element element)
{
if (element == null)

Просмотреть файл

@ -287,7 +287,10 @@ namespace Microsoft.Maui.Controls
oldQuery = oldQuery ?? new ShellRouteParameters();
if (content is IQueryAttributable attributable)
attributable.ApplyQueryAttributes(query);
{
attributable
.ApplyQueryAttributes(query.ToReadOnlyIfUsingShellNavigationQueryParameters());
}
if (content is BindableObject bindable && bindable.BindingContext != null && content != bindable.BindingContext)
ApplyQueryAttributes(bindable.BindingContext, query, oldQuery);
@ -295,7 +298,10 @@ namespace Microsoft.Maui.Controls
var type = content.GetType();
var queryPropertyAttributes = type.GetCustomAttributes(typeof(QueryPropertyAttribute), true);
if (queryPropertyAttributes.Length == 0)
{
ClearQueryIfAppliedToPage(query, content);
return;
}
foreach (QueryPropertyAttribute attrib in queryPropertyAttributes)
{
@ -327,6 +333,16 @@ namespace Microsoft.Maui.Controls
prop.SetValue(content, null);
}
}
ClearQueryIfAppliedToPage(query, content);
static void ClearQueryIfAppliedToPage(ShellRouteParameters query, object content)
{
// Once we've applied the attributes to ContentPage lets remove the
// parameters used during navigation
if (content is ContentPage)
query.ResetToQueryParameters();
}
}
}
}

Просмотреть файл

@ -92,8 +92,7 @@ namespace Microsoft.Maui.Controls
var uri = navigationRequest.Request.FullUri;
var queryString = navigationRequest.Query;
var queryData = ParseQueryString(queryString);
parameters.Merge(queryData);
parameters.SetQueryStringParameters(queryString);
ApplyQueryAttributes(_shell, parameters, false, false);
var shellItem = navigationRequest.Request.Item;
@ -306,17 +305,7 @@ namespace Microsoft.Maui.Controls
baseShellItem = element?.Parent as BaseShellItem;
//filter the query to only apply the keys with matching prefix
var filteredQuery = new ShellRouteParameters(query.Count);
foreach (var q in query)
{
if (!q.Key.StartsWith(prefix, StringComparison.Ordinal))
continue;
var key = q.Key.Substring(prefix.Length);
if (key.IndexOf(".", StringComparison.Ordinal) != -1)
continue;
filteredQuery.Add(key, q.Value);
}
var filteredQuery = new ShellRouteParameters(query, prefix);
if (baseShellItem is ShellContent)
@ -488,24 +477,6 @@ namespace Microsoft.Maui.Controls
return ShellNavigationSource.Push;
}
static Dictionary<string, string> ParseQueryString(string query)
{
if (query.StartsWith("?", StringComparison.Ordinal))
query = query.Substring(1);
Dictionary<string, string> lookupDict = new(StringComparer.Ordinal);
if (query == null)
return lookupDict;
foreach (var part in query.Split('&'))
{
var p = part.Split('=');
if (p.Length != 2)
continue;
lookupDict[p[0]] = p[1];
}
return lookupDict;
}
public static ShellNavigationParameters GetNavigationParameters(
ShellItem shellItem,
ShellSection shellSection,

Просмотреть файл

@ -0,0 +1,110 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.Maui.Controls
{
public class ShellNavigationQueryParameters : IDictionary<string, object>
{
Dictionary<string, object> _internal = new Dictionary<string, object>();
bool _isReadonly;
public ShellNavigationQueryParameters()
{
}
public ShellNavigationQueryParameters(IEnumerable<KeyValuePair<string, object>> collection)
{
foreach (var item in collection)
this.Add(item.Key, item.Value);
}
public ShellNavigationQueryParameters(IDictionary<string, object> dictionary)
{
foreach (var item in dictionary)
this.Add(item.Key, item.Value);
}
internal ShellNavigationQueryParameters SetToReadOnly()
{
_isReadonly = true;
return this;
}
void CheckReadOnlyState()
{
if (_isReadonly)
throw new InvalidOperationException($"ShellNavigationQueryParameters are ReadOnly");
}
public object this[string key]
{
get => _internal[key];
set
{
CheckReadOnlyState();
_internal[key] = value;
}
}
public ICollection<string> Keys => _internal.Keys;
public ICollection<object> Values => _internal.Values;
public int Count => _internal.Count;
public bool IsReadOnly => _isReadonly;
public void Add(string key, object value)
{
CheckReadOnlyState();
_internal.Add(key, value);
}
public void Add(KeyValuePair<string, object> item)
{
CheckReadOnlyState();
_internal.Add(item.Key, item.Value);
}
public void Clear()
{
CheckReadOnlyState();
_internal.Clear();
}
public bool Contains(KeyValuePair<string, object> item) => _internal.ContainsKey(item.Key);
public bool ContainsKey(string key) => _internal.ContainsKey(key);
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
=> (_internal as ICollection<KeyValuePair<string, object>>)?.CopyTo(array, arrayIndex);
public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => _internal.GetEnumerator();
public bool Remove(string key)
{
CheckReadOnlyState();
return _internal.Remove(key);
}
public bool Remove(KeyValuePair<string, object> item)
{
CheckReadOnlyState();
return (_internal as ICollection<KeyValuePair<string, object>>).Remove(item);
}
#if NETSTANDARD2_1 || NETSTANDARD2_0
public bool TryGetValue(string key, out object value)
#else
public bool TryGetValue(string key, [MaybeNullWhen(false)] out object value)
#endif
{
return _internal.TryGetValue(key, out value);
}
IEnumerator IEnumerable.GetEnumerator() =>
_internal.GetEnumerator();
}
}

Просмотреть файл

@ -1,5 +1,6 @@
#nullable disable
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
@ -7,34 +8,115 @@ namespace Microsoft.Maui.Controls
{
internal class ShellRouteParameters : Dictionary<string, object>
{
readonly ShellNavigationQueryParameters _shellNavigationQueryParameters =
new ShellNavigationQueryParameters();
public ShellRouteParameters()
{
}
public ShellRouteParameters(ShellRouteParameters shellRouteParams) : base(shellRouteParams)
{
foreach (var item in shellRouteParams._shellNavigationQueryParameters)
_shellNavigationQueryParameters[item.Key] = item.Value;
}
public ShellRouteParameters(IDictionary<string, object> shellRouteParams) : base(shellRouteParams)
internal IDictionary<string, object> ToReadOnlyIfUsingShellNavigationQueryParameters()
{
if (_shellNavigationQueryParameters.Count > 0)
{
var returnValue = new ShellNavigationQueryParameters(_shellNavigationQueryParameters);
foreach (var item in this)
{
if (!returnValue.ContainsKey(item.Key))
returnValue.Add(item.Key, item.Value);
}
return returnValue.SetToReadOnly();
}
return this;
}
internal ShellRouteParameters(ShellRouteParameters query, string prefix)
: base(query.Count)
{
foreach (var q in query)
{
if (!q.Key.StartsWith(prefix, StringComparison.Ordinal))
continue;
var key = q.Key.Substring(prefix.Length);
if (key.IndexOf(".", StringComparison.Ordinal) != -1)
continue;
this.Add(key, q.Value);
}
foreach (var item in query._shellNavigationQueryParameters)
_shellNavigationQueryParameters[item.Key] = item.Value;
}
internal ShellRouteParameters(IDictionary<string, object> shellRouteParams) : base(shellRouteParams)
{
}
public ShellRouteParameters(int count)
: base(count)
internal ShellRouteParameters(ShellNavigationQueryParameters shellNavigationQueryParameterss)
{
foreach (var item in shellNavigationQueryParameterss)
this.Add(item.Key, item.Value);
foreach (var item in shellNavigationQueryParameterss)
_shellNavigationQueryParameters[item.Key] = item.Value;
}
internal void Merge(IDictionary<string, string> input)
internal void ResetToQueryParameters()
{
if (input == null || input.Count == 0)
if (_shellNavigationQueryParameters.Count == 0)
return;
foreach (var item in input)
Add(item.Key, item.Value);
foreach (var item in _shellNavigationQueryParameters)
{
if (this.ContainsKey(item.Key))
{
this.Remove(item.Key);
}
}
_shellNavigationQueryParameters.Clear();
}
internal void SetQueryStringParameters(string query)
{
var queryStringParameters = ParseQueryString(query);
if (queryStringParameters == null || queryStringParameters.Count == 0)
return;
foreach (var item in queryStringParameters)
{
if (!this.ContainsKey(item.Key))
this[item.Key] = item.Value;
}
}
static Dictionary<string, string> ParseQueryString(string query)
{
if (query.StartsWith("?", StringComparison.Ordinal))
query = query.Substring(1);
Dictionary<string, string> lookupDict = new(StringComparer.Ordinal);
if (query == null)
return lookupDict;
foreach (var part in query.Split('&'))
{
var p = part.Split('=');
if (p.Length != 2)
continue;
lookupDict[p[0]] = p[1];
}
return lookupDict;
}
}
internal static class ShellParameterExtensions
{
public static void Deconstruct(this KeyValuePair<string, object> tuple, out string key, out object value)

Просмотреть файл

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Maui.Controls.Platform;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
using Microsoft.UI.Xaml.Controls;
using NativeAutomationProperties = Microsoft.UI.Xaml.Automation.AutomationProperties;
using WImage = Microsoft.UI.Xaml.Controls.Image;
@ -18,13 +17,21 @@ namespace Microsoft.Maui.Controls
NavigationRootManager? NavigationRootManager =>
MauiContext?.GetNavigationRootManager();
partial void OnHandlerChanging(IElementHandler oldHandler, IElementHandler newHandler)
{
if (newHandler == null)
{
foreach (var item in ToolbarItems)
item.PropertyChanged -= OnToolbarItemPropertyChanged;
}
}
internal void UpdateMenu()
{
if (Handler.PlatformView is not MauiToolbar wh)
return;
var commandBar = wh.CommandBar;
if (commandBar == null)
{
return;
@ -71,8 +78,62 @@ namespace Microsoft.Maui.Controls
{
commandBar.SecondaryCommands.Add(button);
}
item.PropertyChanged -= OnToolbarItemPropertyChanged;
item.PropertyChanged += OnToolbarItemPropertyChanged;
}
SetDefaultLabelPosition(commandBar, toolbarItems);
}
internal void OnToolbarItemPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (Handler.PlatformView is not MauiToolbar wh)
return;
var commandBar = wh.CommandBar;
if (commandBar == null)
{
return;
}
if (e.PropertyName == nameof(ToolbarItem.Text) || e.PropertyName == nameof(ToolbarItem.IconImageSource))
{
var toolbarItems = new List<ToolbarItem>(ToolbarItems ?? Array.Empty<ToolbarItem>());
SetDefaultLabelPosition(commandBar, toolbarItems);
}
}
private static void SetDefaultLabelPosition(CommandBar commandBar, IList<ToolbarItem> toolbarItems)
{
int itemsWithTextCount = 0;
int itemsWithIconCount = 0;
foreach (ToolbarItem item in toolbarItems)
{
if (!string.IsNullOrEmpty(item.Text))
{
itemsWithTextCount++;
}
if (item.IconImageSource != null)
{
itemsWithIconCount++;
}
}
bool allItemsHaveIcons = toolbarItems.Count == itemsWithIconCount;
// All items have icons, none have text
if (allItemsHaveIcons && itemsWithTextCount == 0)
{
commandBar.DefaultLabelPosition = CommandBarDefaultLabelPosition.Collapsed;
}
else
{
commandBar.DefaultLabelPosition = CommandBarDefaultLabelPosition.Right;
}
}
public static void MapBarTextColor(ToolbarHandler arg1, Toolbar arg2) =>
MapBarTextColor((IToolbarHandler)arg1, arg2);

Просмотреть файл

@ -21,8 +21,12 @@ namespace Microsoft.Maui.Controls
/// <include file="../../docs/Microsoft.Maui.Controls/VisualElement.xml" path="//Member[@MemberName='StyleProperty']/Docs/*" />
public new static readonly BindableProperty StyleProperty = NavigableElement.StyleProperty;
bool _inputTransparentExplicit = (bool)InputTransparentProperty.DefaultValue;
/// <summary>Bindable property for <see cref="InputTransparent"/>.</summary>
public static readonly BindableProperty InputTransparentProperty = BindableProperty.Create("InputTransparent", typeof(bool), typeof(VisualElement), default(bool));
public static readonly BindableProperty InputTransparentProperty = BindableProperty.Create(
"InputTransparent", typeof(bool), typeof(VisualElement), default(bool),
propertyChanged: OnInputTransparentPropertyChanged, coerceValue: CoerceInputTransparentProperty);
bool _isEnabledExplicit = (bool)IsEnabledProperty.DefaultValue;
@ -586,6 +590,40 @@ namespace Microsoft.Maui.Controls
}
}
/// <summary>
/// This value represents the cumulative InputTransparent value.
/// All types that override this property need to also invoke
/// the RefreshInputTransparentProperty() method if the value will change.
///
/// This method is not virtual as none of the derived types actually need
/// to change the calculation. If this ever needs to change, then the
/// RefreshInputTransparentProperty() method should also call the
/// RefreshPropertyValue() method - just like how the
/// RefreshIsEnabledProperty() method does.
/// </summary>
private protected bool InputTransparentCore
{
get
{
if (_inputTransparentExplicit == true)
{
// If the explicitly set value is true, then nothing else matters
// And we can save the effort of a Parent check
return true;
}
var parent = Parent as IInputTransparentContainerElement;
while (parent is not null)
{
if (parent.CascadeInputTransparent && parent.InputTransparent)
return true;
parent = parent.Parent as IInputTransparentContainerElement;
}
return _inputTransparentExplicit;
}
}
/// <include file="../../docs/Microsoft.Maui.Controls/VisualElement.xml" path="//Member[@MemberName='IsFocused']/Docs/*" />
public bool IsFocused => (bool)GetValue(IsFocusedProperty);
@ -1276,6 +1314,22 @@ namespace Microsoft.Maui.Controls
(bindable as IPropertyPropagationController)?.PropagatePropertyChanged(VisualElement.IsEnabledProperty.PropertyName);
}
static object CoerceInputTransparentProperty(BindableObject bindable, object value)
{
if (bindable is VisualElement visualElement)
{
visualElement._inputTransparentExplicit = (bool)value;
return visualElement.InputTransparentCore;
}
return false;
}
static void OnInputTransparentPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
(bindable as IPropertyPropagationController)?.PropagatePropertyChanged(VisualElement.InputTransparentProperty.PropertyName);
}
static void OnIsFocusedPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)
{
var element = (VisualElement)bindable;
@ -1335,6 +1389,9 @@ namespace Microsoft.Maui.Controls
if (propertyName == null || propertyName == IsEnabledProperty.PropertyName)
this.RefreshPropertyValue(IsEnabledProperty, _isEnabledExplicit);
if (propertyName == null || propertyName == InputTransparentProperty.PropertyName)
this.RefreshPropertyValue(InputTransparentProperty, _inputTransparentExplicit);
PropertyPropagationExtensions.PropagatePropertyChanged(propertyName, this, ((IVisualTreeElement)this).GetVisualChildren());
}
@ -1345,6 +1402,20 @@ namespace Microsoft.Maui.Controls
protected void RefreshIsEnabledProperty() =>
this.RefreshPropertyValue(IsEnabledProperty, _isEnabledExplicit);
/// <summary>
/// This method must always be called if some event occurs and the value of
/// the InputTransparentCore property will change.
/// </summary>
private protected void RefreshInputTransparentProperty()
{
// This method does not need to call the
// this.RefreshPropertyValue(InputTransparentProperty, _inputTransparentExplicit);
// method because none of the derived types will affect this view. All we
// need to do is propagate the new value to all the children.
(this as IPropertyPropagationController)?.PropagatePropertyChanged(VisualElement.InputTransparentProperty.PropertyName);
}
void UpdateBoundsComponents(Rect bounds)
{
_frame = bounds;

Просмотреть файл

@ -506,6 +506,7 @@ namespace Microsoft.Maui.Controls
Destroying?.Invoke(this, EventArgs.Empty);
OnDestroying();
AlertManager.Unsubscribe();
Application?.RemoveWindow(this);
Handler?.DisconnectHandler();
}

Просмотреть файл

@ -128,63 +128,6 @@ namespace Microsoft.Maui.Controls.Core.UnitTests.Layouts
return layout;
}
[Fact]
public void AddRespectsCascadeInputTransparent()
{
var layout = new VerticalStackLayout()
{
InputTransparent = true,
CascadeInputTransparent = true
};
var handler = Substitute.For<IViewHandler>();
layout.Handler = handler;
var child0 = new Button() { InputTransparent = false };
layout.Add(child0);
handler.Received().UpdateValue(Arg.Is(nameof(Layout.CascadeInputTransparent)));
}
[Fact]
public void InsertRespectsCascadeInputTransparent()
{
var layout = new VerticalStackLayout()
{
InputTransparent = true,
CascadeInputTransparent = true
};
var handler = Substitute.For<IViewHandler>();
layout.Handler = handler;
var child0 = new Button() { InputTransparent = false };
layout.Insert(0, child0);
handler.Received().UpdateValue(Arg.Is(nameof(Layout.CascadeInputTransparent)));
}
[Fact]
public void UpdateRespectsCascadeInputTransparent()
{
var layout = new VerticalStackLayout()
{
InputTransparent = true,
CascadeInputTransparent = true
};
var handler = Substitute.For<IViewHandler>();
layout.Handler = handler;
var child0 = new Button() { InputTransparent = false };
layout.Add(child0);
var child1 = new Button() { InputTransparent = false };
layout[0] = child1;
handler.Received(2).UpdateValue(Arg.Is(nameof(Layout.CascadeInputTransparent)));
}
IMauiContext SetupContext(ILayoutManagerFactory layoutManagerFactory)
{
var services = Substitute.For<IServiceProvider>();

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
@ -150,7 +151,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
await shell.GoToAsync(new ShellNavigationState($"//content?{nameof(ShellTestPage.SomeQueryParameter)}=1234"));
await shell.GoToAsync(new ShellNavigationState($"//section2/details?{nameof(ShellTestPage.SomeQueryParameter)}=4321"));
var testPage = (shell.CurrentItem.CurrentItem as IShellSectionController).PresentedPage as ShellTestPage;
var testPage = shell.CurrentPage as ShellTestPage;
Assert.Equal("4321", testPage.SomeQueryParameter);
}
@ -200,7 +201,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
await shellController.OnFlyoutItemSelectedAsync(flyoutItem1);
await shellController.OnFlyoutItemSelectedAsync(flyoutItem2);
var testPage = (shell.CurrentItem.CurrentItem as IShellSectionController).PresentedPage as ShellTestPage;
var testPage = shell.CurrentPage as ShellTestPage;
Assert.Equal("1234", testPage.SomeQueryParameter);
}
@ -213,7 +214,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
Routing.RegisterRoute("details", typeof(ShellTestPage));
shell.Items.Add(item);
await shell.GoToAsync(new ShellNavigationState($"details?{nameof(ShellTestPage.SomeQueryParameter)}=1234"));
var testPage = (shell.CurrentItem.CurrentItem as IShellSectionController).PresentedPage as ShellTestPage;
var testPage = shell.CurrentPage as ShellTestPage;
Assert.Equal("1234", testPage.SomeQueryParameter);
}
@ -290,7 +291,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
Routing.RegisterRoute("details", typeof(ShellTestPage));
shell.Items.Add(item);
await shell.GoToAsync(new ShellNavigationState($"details?{nameof(ShellTestPage.DoubleQueryParameter)}=1234"));
var testPage = (shell.CurrentItem.CurrentItem as IShellSectionController).PresentedPage as ShellTestPage;
var testPage = shell.CurrentPage as ShellTestPage;
Assert.Equal(1234d, testPage.DoubleQueryParameter);
}
@ -370,12 +371,150 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
};
await shell.GoToAsync(new ShellNavigationState($"details?{nameof(ShellTestPage.SomeQueryParameter)}=1234"), parameter);
var testPage = (shell.CurrentItem.CurrentItem as IShellSectionController).PresentedPage as ShellTestPage;
var testPage = shell.CurrentPage as ShellTestPage;
Assert.Equal("1234", testPage.SomeQueryParameter);
Assert.Equal(2d, testPage.DoubleQueryParameter);
Assert.Equal(obj, testPage.ComplexObject);
}
[Fact]
public async Task ValidateReadOnlyDictionary()
{
var obj = new object();
var parameter = new ShellNavigationQueryParameters
{
{"DoubleQueryParameter", 2d },
{ "ComplexObject", obj}
}.SetToReadOnly();
Assert.Throws<InvalidOperationException>(() => parameter.Add("key", "value"));
Assert.Throws<InvalidOperationException>(() => parameter.Add(new KeyValuePair<string, object>("key", "value")));
Assert.Throws<InvalidOperationException>(() => parameter.Remove(parameter.First()));
Assert.Throws<InvalidOperationException>(() => parameter.Remove("DoubleQueryParameter"));
Assert.Throws<InvalidOperationException>(() => parameter["key"] = "value");
Assert.Throws<InvalidOperationException>(() => parameter.Clear());
}
[Fact]
public async Task ShellNavigationQueryParametersPassedInAsReadOnly()
{
var shell = new Shell();
var item = CreateShellItem(shellSectionRoute: "section2");
Routing.RegisterRoute("details", typeof(ShellTestPage));
shell.Items.Add(item);
var obj = new object();
var parameter = new ShellNavigationQueryParameters
{
{"DoubleQueryParameter", 2d },
{ "ComplexObject", obj}
};
await shell.GoToAsync(new ShellNavigationState($"details"), parameter);
var testPage = shell.CurrentPage as ShellTestPage;
Assert.True(testPage.AppliedQueryAttributes[0].IsReadOnly);
Assert.False(parameter.IsReadOnly);
Assert.Single(testPage.AppliedQueryAttributes);
}
[Fact]
public async Task ExtraParametersDontGetRetained()
{
var shell = new Shell();
var item = CreateShellItem(shellSectionRoute: "section2");
Routing.RegisterRoute("details", typeof(ShellTestPage));
shell.Items.Add(item);
var obj = new object();
var parameter = new ShellNavigationQueryParameters
{
{"DoubleQueryParameter", 2d },
{"ComplexObject", obj}
};
await shell.GoToAsync(new ShellNavigationState($"details?{nameof(ShellTestPage.SomeQueryParameter)}=1234"), parameter);
var testPage = shell.CurrentPage as ShellTestPage;
await shell.Navigation.PushAsync(new ContentPage());
testPage.SomeQueryParameter = String.Empty;
testPage.DoubleQueryParameter = -1d;
testPage.ComplexObject = null;
await shell.GoToAsync("..");
Assert.Equal("1234", testPage.SomeQueryParameter);
Assert.Equal(-1d, testPage.DoubleQueryParameter);
Assert.Null(testPage.ComplexObject);
// ensure that AppliedQueryAttributes is called with correct parameters each time
Assert.Equal(2, testPage.AppliedQueryAttributes.Count);
Assert.Equal(3, testPage.AppliedQueryAttributes[0].Count);
Assert.Equal(1, testPage.AppliedQueryAttributes[1].Count);
Assert.Equal($"{nameof(ShellTestPage.SomeQueryParameter)}", testPage.AppliedQueryAttributes[1].Keys.First());
}
[Fact]
public async Task ExtraParametersArentReAppliedWhenNavigatingBackToShellContent()
{
var shell = new Shell();
var item = CreateShellItem(shellContentRoute: "start");
var withParams = CreateShellItem(page: new ShellTestPage(), shellContentRoute: "withParams", templated: true);
shell.Items.Add(item);
shell.Items.Add(withParams);
var obj = new object();
var parameter = new ShellRouteParameters
{
{ "ComplexObject", obj},
{ nameof(ShellTestPage.SomeQueryParameter), "1234"}
};
await shell.GoToAsync(new ShellNavigationState($"//start"));
await shell.GoToAsync(new ShellNavigationState($"//withParams"), parameter);
var testPage = (shell.CurrentItem.CurrentItem.CurrentItem as IShellContentController).GetOrCreateContent() as ShellTestPage;
// Validate parameter was set during first navigation
Assert.Equal(obj, testPage.ComplexObject);
// Clear parameters
testPage.ComplexObject = null;
testPage.SomeQueryParameter = null;
// Navigate away and back to page with params
await shell.GoToAsync(new ShellNavigationState($"//start"));
shell.CurrentItem = withParams;
await Task.Yield();
var testPage2 = shell.CurrentPage as ShellTestPage;
Assert.Null(testPage2.SomeQueryParameter);
Assert.Null(testPage2.ComplexObject);
Assert.Equal(testPage2, testPage);
}
[Fact]
public async Task SingleUseQueryParametersReplaceQueryStringParams()
{
var shell = new Shell();
var item = CreateShellItem(shellSectionRoute: "section2");
Routing.RegisterRoute("details", typeof(ShellTestPage));
shell.Items.Add(item);
var parameter = new ShellNavigationQueryParameters()
{
{nameof(ShellTestPage.SomeQueryParameter), "4321" }
};
await shell.GoToAsync(new ShellNavigationState($"details?{nameof(ShellTestPage.SomeQueryParameter)}=1234"), parameter);
var testPage = shell.CurrentPage as ShellTestPage;
// Parameters passed in will win
Assert.Equal("4321", testPage.SomeQueryParameter);
await shell.Navigation.PushAsync(new ContentPage());
testPage.SomeQueryParameter = "TheseDontGetSetAgain";
await shell.GoToAsync("..");
Assert.Equal("TheseDontGetSetAgain", testPage.SomeQueryParameter);
}
[Fact]
public async Task DotDotNavigationPassesShellParameters()
{

Просмотреть файл

@ -88,7 +88,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
[QueryProperty("SomeQueryParameter", "SomeQueryParameter")]
[QueryProperty("CancelNavigationOnBackButtonPressed", "CancelNavigationOnBackButtonPressed")]
[QueryProperty("ComplexObject", "ComplexObject")]
public class ShellTestPage : ContentPage
public class ShellTestPage : ContentPage, IQueryAttributable
{
public string CancelNavigationOnBackButtonPressed { get; set; }
public ShellTestPage()
@ -128,6 +128,15 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
return base.OnBackButtonPressed();
}
public List<IDictionary<string, object>> AppliedQueryAttributes = new List<IDictionary<string, object>>();
public void ApplyQueryAttributes(IDictionary<string, object> query)
{
if (query is ShellNavigationQueryParameters param && param.IsReadOnly)
AppliedQueryAttributes.Add(query);
else
AppliedQueryAttributes.Add(new Dictionary<string, object>(query));
}
}
protected ShellItem CreateShellItem(

Просмотреть файл

@ -0,0 +1,557 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Maui.Controls.Shapes;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Primitives;
using Xunit;
using Xunit.Sdk;
namespace Microsoft.Maui.Controls.Core.UnitTests
{
public class VisualElementInputTransparentTests
{
// this is both for color diff and cols
const bool truee = true;
static IReadOnlyDictionary<(bool, bool, bool, bool, bool), (bool, bool)> States = new Dictionary<(bool, bool, bool, bool, bool), (bool, bool)>
{
[(truee, truee, truee, truee, truee)] = (truee, truee),
[(truee, truee, truee, truee, false)] = (truee, truee),
[(truee, truee, truee, false, truee)] = (truee, truee),
[(truee, truee, truee, false, false)] = (truee, truee),
[(truee, truee, false, truee, truee)] = (truee, truee),
[(truee, truee, false, truee, false)] = (truee, truee),
[(truee, truee, false, false, truee)] = (truee, truee),
[(truee, truee, false, false, false)] = (truee, truee),
[(truee, false, truee, truee, truee)] = (truee, truee),
[(truee, false, truee, truee, false)] = (truee, truee),
[(truee, false, truee, false, truee)] = (truee, truee),
[(truee, false, truee, false, false)] = (truee, false),
[(truee, false, false, truee, truee)] = (false, truee),
[(truee, false, false, truee, false)] = (false, false),
[(truee, false, false, false, truee)] = (false, truee),
[(truee, false, false, false, false)] = (false, false),
[(false, truee, truee, truee, truee)] = (truee, truee),
[(false, truee, truee, truee, false)] = (truee, truee),
[(false, truee, truee, false, truee)] = (truee, truee),
[(false, truee, truee, false, false)] = (truee, false),
[(false, truee, false, truee, truee)] = (false, truee),
[(false, truee, false, truee, false)] = (false, false),
[(false, truee, false, false, truee)] = (false, truee),
[(false, truee, false, false, false)] = (false, false),
[(false, false, truee, truee, truee)] = (truee, truee),
[(false, false, truee, truee, false)] = (truee, truee),
[(false, false, truee, false, truee)] = (truee, truee),
[(false, false, truee, false, false)] = (truee, false),
[(false, false, false, truee, truee)] = (false, truee),
[(false, false, false, truee, false)] = (false, false),
[(false, false, false, false, truee)] = (false, truee),
[(false, false, false, false, false)] = (false, false),
};
public static IEnumerable<object[]> TransparencyStates()
{
foreach (var pair in States)
{
var (rT, rC, nT, nC, t) = pair.Key;
yield return new object[] { rT, rC, nT, nC, t };
}
}
static (Layout Root, Layout Nested, VisualElement Child) CreateViews(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
Layout root;
Layout nested;
VisualElement child;
root = new Grid
{
InputTransparent = rootTrans,
CascadeInputTransparent = rootCascade,
Children =
{
(nested = new Grid
{
InputTransparent = nestedTrans,
CascadeInputTransparent = nestedCascade,
Children =
{
(child = new Button
{
InputTransparent = trans
})
}
})
}
};
return (root, nested, child);
}
static void AssertState(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans, Layout nested, VisualElement child)
{
var (finalNestedTrans, finalTrans) = States[(rootTrans, rootCascade, nestedTrans, nestedCascade, trans)];
if (finalNestedTrans)
Assert.True(nested.InputTransparent, "Nested layout was not input transparent when it should have been.");
else
Assert.False(nested.InputTransparent, "Nested layout was input transparent when it should not have been.");
if (finalTrans)
Assert.True(child.InputTransparent, "Child element was not input transparent when it should have been.");
else
Assert.False(child.InputTransparent, "Child element was input transparent when it should not have been.");
}
static void AssertState(bool layoutTrans, bool layoutCascade, bool trans, Layout layout, VisualElement child)
{
var (finalLayoutTrans, finalTrans) = States[(false, false, layoutTrans, layoutCascade, trans)];
if (finalLayoutTrans)
Assert.True(layout.InputTransparent, "Layout was not input transparent when it should have been.");
else
Assert.False(layout.InputTransparent, "Layout was input transparent when it should not have been.");
if (finalTrans)
Assert.True(child.InputTransparent, "Child element was not input transparent when it should have been.");
else
Assert.False(child.InputTransparent, "Child element was input transparent when it should not have been.");
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void TestMethodsAreValid(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var (rootLayout, nestedLayout, element) = CreateViews(rootTrans, rootCascade, nestedTrans, nestedCascade, trans);
AssertState(rootTrans, rootCascade, nestedTrans, nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void InitialStateIsCorrectWhenOrderIsPropsRootChildNestedChild(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var rootLayout = new Grid
{
InputTransparent = rootTrans,
CascadeInputTransparent = rootCascade
};
var nestedLayout = new Grid
{
InputTransparent = nestedTrans,
CascadeInputTransparent = nestedCascade
};
var element = new Button
{
InputTransparent = trans
};
rootLayout.Add(nestedLayout);
nestedLayout.Add(element);
AssertState(rootTrans, rootCascade, nestedTrans, nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void InitialStateIsCorrectWhenOrderIsPropsNestedChildRootChild(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var rootLayout = new Grid
{
InputTransparent = rootTrans,
CascadeInputTransparent = rootCascade
};
var nestedLayout = new Grid
{
InputTransparent = nestedTrans,
CascadeInputTransparent = nestedCascade
};
var element = new Button
{
InputTransparent = trans
};
nestedLayout.Add(element);
rootLayout.Add(nestedLayout);
AssertState(rootTrans, rootCascade, nestedTrans, nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void StateIsCorrectWhenSettingChildNestedRoot(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var element = new Button();
var nestedLayout = new Grid { element };
var rootLayout = new Grid { nestedLayout };
element.InputTransparent = trans;
nestedLayout.InputTransparent = nestedTrans;
nestedLayout.CascadeInputTransparent = nestedCascade;
rootLayout.InputTransparent = rootTrans;
rootLayout.CascadeInputTransparent = rootCascade;
AssertState(rootTrans, rootCascade, nestedTrans, nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void StateIsCorrectWhenSettingRootNestedChild(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var element = new Button();
var nestedLayout = new Grid { element };
var rootLayout = new Grid { nestedLayout };
rootLayout.InputTransparent = rootTrans;
rootLayout.CascadeInputTransparent = rootCascade;
nestedLayout.InputTransparent = nestedTrans;
nestedLayout.CascadeInputTransparent = nestedCascade;
element.InputTransparent = trans;
AssertState(rootTrans, rootCascade, nestedTrans, nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void InvertingRootLayoutInputTransparentIsCorrect(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var (rootLayout, nestedLayout, element) = CreateViews(rootTrans, rootCascade, nestedTrans, nestedCascade, trans);
rootLayout.InputTransparent = !rootTrans;
AssertState(!rootTrans, rootCascade, nestedTrans, nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void InvertingRootLayoutCascadeInputTransparentIsCorrect(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var (rootLayout, nestedLayout, element) = CreateViews(rootTrans, rootCascade, nestedTrans, nestedCascade, trans);
rootLayout.CascadeInputTransparent = !rootCascade;
AssertState(rootTrans, !rootCascade, nestedTrans, nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void InvertingNestedLayoutInputTransparentIsCorrect(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var (rootLayout, nestedLayout, element) = CreateViews(rootTrans, rootCascade, nestedTrans, nestedCascade, trans);
nestedLayout.InputTransparent = !nestedTrans;
AssertState(rootTrans, rootCascade, !nestedTrans, nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void InvertingNestedLayoutCascadeInputTransparentIsCorrect(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var (rootLayout, nestedLayout, element) = CreateViews(rootTrans, rootCascade, nestedTrans, nestedCascade, trans);
nestedLayout.CascadeInputTransparent = !nestedCascade;
AssertState(rootTrans, rootCascade, nestedTrans, !nestedCascade, trans, nestedLayout, element);
}
[Theory]
[MemberData(nameof(TransparencyStates))]
public void InvertingChildInputTransparentIsCorrect(bool rootTrans, bool rootCascade, bool nestedTrans, bool nestedCascade, bool trans)
{
var (rootLayout, nestedLayout, element) = CreateViews(rootTrans, rootCascade, nestedTrans, nestedCascade, trans);
element.InputTransparent = !trans;
AssertState(rootTrans, rootCascade, nestedTrans, nestedCascade, !trans, nestedLayout, element);
}
[Theory]
[InlineData(typeof(Button))]
[InlineData(typeof(VerticalStackLayout))]
[InlineData(typeof(Editor))]
[InlineData(typeof(Entry))]
public void VisualElementsCanToggleInputTransparency(Type type)
{
var element = (VisualElement)Activator.CreateInstance(type);
Assert.False(element.InputTransparent);
element.InputTransparent = true;
Assert.True(element.InputTransparent);
element.InputTransparent = false;
Assert.False(element.InputTransparent);
}
// TODO: the tests below may be duplicates of the tests above
[Theory]
[InlineData(typeof(Button), true)]
[InlineData(typeof(VerticalStackLayout), true)]
[InlineData(typeof(Editor), true)]
[InlineData(typeof(Entry), true)]
[InlineData(typeof(Button), false)]
[InlineData(typeof(VerticalStackLayout), false)]
[InlineData(typeof(Editor), false)]
[InlineData(typeof(Entry), false)]
public void InputTransparencyOnLayoutDoesNotAffectChildWhenNotCascadeInputTransparent(Type type, bool initialInputTransparent)
{
var element = (View)Activator.CreateInstance(type);
var layout = new Grid
{
InputTransparent = initialInputTransparent,
CascadeInputTransparent = false,
Children =
{
element
}
};
AssertState(initialInputTransparent, false, false, layout, element);
layout.InputTransparent = !initialInputTransparent;
AssertState(!initialInputTransparent, false, false, layout, element);
layout.InputTransparent = initialInputTransparent;
AssertState(initialInputTransparent, false, false, layout, element);
}
[Theory]
[InlineData(typeof(Button), true)]
[InlineData(typeof(VerticalStackLayout), true)]
[InlineData(typeof(Editor), true)]
[InlineData(typeof(Entry), true)]
[InlineData(typeof(Button), false)]
[InlineData(typeof(VerticalStackLayout), false)]
[InlineData(typeof(Editor), false)]
[InlineData(typeof(Entry), false)]
public void InputTransparencyOnLayoutAffectsChild(Type type, bool initialInputTransparent)
{
var element = (View)Activator.CreateInstance(type);
var layout = new Grid
{
InputTransparent = initialInputTransparent,
CascadeInputTransparent = true, // default
Children =
{
element
}
};
AssertState(initialInputTransparent, true, false, layout, element);
layout.InputTransparent = !initialInputTransparent;
AssertState(!initialInputTransparent, true, false, layout, element);
layout.InputTransparent = initialInputTransparent;
AssertState(initialInputTransparent, true, false, layout, element);
}
[Theory]
[InlineData(typeof(Button), true)]
[InlineData(typeof(VerticalStackLayout), true)]
[InlineData(typeof(Editor), true)]
[InlineData(typeof(Entry), true)]
[InlineData(typeof(Button), false)]
[InlineData(typeof(VerticalStackLayout), false)]
[InlineData(typeof(Editor), false)]
[InlineData(typeof(Entry), false)]
public void InputTransparencyOnLayoutDoesNotAffectDeeplyNestedChildWhenNotCascadeInputTransparent(Type type, bool initialInputTransparent)
{
var element = (View)Activator.CreateInstance(type);
var layout = new Grid
{
InputTransparent = initialInputTransparent,
CascadeInputTransparent = false,
Children =
{
new Grid { new Grid { new Grid { element } } }
}
};
AssertState(initialInputTransparent, false, false, layout, element);
layout.InputTransparent = !initialInputTransparent;
AssertState(!initialInputTransparent, false, false, layout, element);
layout.InputTransparent = initialInputTransparent;
AssertState(initialInputTransparent, false, false, layout, element);
}
[Theory]
[InlineData(typeof(Button), true)]
[InlineData(typeof(VerticalStackLayout), true)]
[InlineData(typeof(Editor), true)]
[InlineData(typeof(Entry), true)]
[InlineData(typeof(Button), false)]
[InlineData(typeof(VerticalStackLayout), false)]
[InlineData(typeof(Editor), false)]
[InlineData(typeof(Entry), false)]
public void InputTransparencyOnLayoutAffectsDeeplyNestedChild(Type type, bool initialInputTransparent)
{
var element = (View)Activator.CreateInstance(type);
var layout = new Grid
{
InputTransparent = initialInputTransparent,
CascadeInputTransparent = true, // default
Children =
{
new Grid { new Grid { new Grid { element } } }
}
};
AssertState(initialInputTransparent, true, false, layout, element);
layout.InputTransparent = !initialInputTransparent;
AssertState(!initialInputTransparent, true, false, layout, element);
layout.InputTransparent = initialInputTransparent;
AssertState(initialInputTransparent, true, false, layout, element);
}
[Theory]
[InlineData(true, true)]
[InlineData(true, false)]
[InlineData(false, true)]
[InlineData(false, false)]
public void InputTransparencyOnLayoutDoesNotOverrideNestedLayoutWhenNotCascadeInputTransparentButCascadeOnNested(bool parent, bool nested)
{
var element = new Button();
Grid nestedLayout;
var layout = new Grid
{
InputTransparent = parent,
CascadeInputTransparent = false,
Children =
{
new Grid
{
(nestedLayout = new Grid
{
InputTransparent = nested,
CascadeInputTransparent = true, // default
Children =
{
new Grid { element }
}
})
}
}
};
AssertState(parent, false, nested, true, false, nestedLayout, element);
layout.InputTransparent = !parent;
AssertState(!parent, false, nested, true, false, nestedLayout, element);
layout.InputTransparent = parent;
AssertState(parent, false, nested, true, false, nestedLayout, element);
}
[Theory]
[InlineData(true, true)]
[InlineData(true, false)]
[InlineData(false, true)]
[InlineData(false, false)]
public void InputTransparencyOnLayoutDoesNotOverrideNestedLayoutWhenNotCascadeInputTransparent(bool parent, bool nested)
{
var element = new Button();
Grid nestedLayout;
var layout = new Grid
{
InputTransparent = parent,
CascadeInputTransparent = false,
Children =
{
new Grid
{
(nestedLayout = new Grid
{
InputTransparent = nested,
CascadeInputTransparent = false,
Children =
{
new Grid { element }
}
})
}
}
};
AssertState(parent, false, nested, false, false, nestedLayout, element);
layout.InputTransparent = !parent;
AssertState(!parent, false, nested, false, false, nestedLayout, element);
layout.InputTransparent = parent;
AssertState(parent, false, nested, false, false, nestedLayout, element);
}
[Theory]
[InlineData(true, true, true)]
[InlineData(true, true, false)]
[InlineData(true, false, true)]
[InlineData(true, false, false)]
[InlineData(false, true, true)]
[InlineData(false, true, false)]
[InlineData(false, false, true)]
[InlineData(false, false, false)]
public void InputTransparencyOnLayoutOverridesNestedLayout(bool parent, bool nested, bool cascadeNested)
{
var element = new Button();
Grid nestedLayout;
var layout = new Grid
{
InputTransparent = parent,
CascadeInputTransparent = true, // default
Children =
{
new Grid
{
(nestedLayout = new Grid
{
InputTransparent = nested,
CascadeInputTransparent = cascadeNested,
Children =
{
new Grid { element }
}
})
}
}
};
AssertState(parent, true, nested, cascadeNested, false, nestedLayout, element);
layout.InputTransparent = !parent;
AssertState(!parent, true, nested, cascadeNested, false, nestedLayout, element);
layout.InputTransparent = parent;
AssertState(parent, true, nested, cascadeNested, false, nestedLayout, element);
}
}
}

Просмотреть файл

@ -231,6 +231,53 @@ namespace Microsoft.Maui.DeviceTests
});
}
/// <summary>
/// This is more complicated as we have different logic depending on the view being focused or not.
/// When we attach to the UI, there is only a single control so sometimes it cannot unfocus.
/// </summary>
public async Task AttachAndRunFocusAffectedControl<TType, THandler>(TType control, Action<THandler> action)
where TType : IView, new()
where THandler : class, IPlatformViewHandler, IElementHandler, new()
{
Func<THandler, Task> boop = (handler) =>
{
action.Invoke(handler);
return Task.CompletedTask;
};
await AttachAndRunFocusAffectedControl<TType, THandler>(control, boop);
}
/// <summary>
/// This is more complicated as we have different logic depending on the view being focused or not.
/// When we attach to the UI, there is only a single control so sometimes it cannot unfocus.
/// </summary>
public async Task AttachAndRunFocusAffectedControl<TType, THandler>(TType control, Func<THandler, Task> action)
where TType : IView, new()
where THandler : class, IPlatformViewHandler, IElementHandler, new()
{
EnsureHandlerCreated(builder =>
{
builder.ConfigureMauiHandlers(handler =>
{
handler.AddHandler<VerticalStackLayout, LayoutHandler>();
handler.AddHandler<TType, THandler>();
});
});
var layout = new VerticalStackLayout
{
WidthRequest = 200,
HeightRequest = 200,
};
var placeholder = new TType();
layout.Add(placeholder);
layout.Add(control);
await AttachAndRun(layout, handler => action(control.Handler as THandler));
}
async protected Task ValidatePropertyInitValue<TValue, THandler>(
IView view,
Func<TValue> GetValue,

Просмотреть файл

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.DeviceTests.Stubs;
using Microsoft.Maui.Platform;
using Xunit;
using AndroidX.AppCompat.App;
using Android.Graphics;
namespace Microsoft.Maui.DeviceTests
{
public partial class AlertDialogTests: ControlsHandlerTestBase
{
async Task<Color> GetDialogButtonTextColor(int nightMode)
{
var mauiContextStub1 = new ContextStub(ApplicationServices);
var activity = mauiContextStub1.GetActivity();
mauiContextStub1.Context = new Android.Views.ContextThemeWrapper(activity, Resource.Style.Maui_MainTheme_NoActionBar);
Color color = Color.Transparent;
await InvokeOnMainThreadAsync(() =>
{
var initialNightMode = activity.Delegate.LocalNightMode;
activity.Delegate.SetLocalNightMode(nightMode);
var builder = new AlertDialog.Builder(activity);
var alertDialog = builder.Create();
alertDialog.Show();
var button = alertDialog.GetButton((int)Android.Content.DialogButtonType.Negative);
var textColor = button.CurrentTextColor;
color = new Color(textColor);
activity.Delegate.SetLocalNightMode(initialNightMode);
alertDialog.Hide();
});
return color;
}
[Fact]
public void AlertDialogButtonColorLightTheme()
{
var textColor = GetDialogButtonTextColor(AppCompatDelegate.ModeNightNo).Result;
Assert.True(textColor.GetBrightness() < 0.5);
}
[Fact]
public void AlertDialogButtonColorDarkTheme()
{
var textColor = GetDialogButtonTextColor(AppCompatDelegate.ModeNightYes).Result;
Assert.True(textColor.GetBrightness() > 0.5);
}
}
}

Просмотреть файл

@ -50,5 +50,37 @@ namespace Microsoft.Maui.DeviceTests
// Without Exceptions here, the test has passed.
Assert.Equal(0, (rootPage as IPageContainer<Page>).CurrentPage.Navigation.ModalStack.Count);
}
[Fact]
public async Task NullItemsSourceDisplaysHeaderFooterAndEmptyView()
{
SetupBuilder();
var emptyView = new Label { Text = "Empty" };
var header = new Label { Text = "Header" };
var footer = new Label { Text = "Footer" };
var collectionView = new CollectionView
{
ItemsSource = null,
EmptyView = emptyView,
Header = header,
Footer = footer
};
ContentPage contentPage = new ContentPage() { Content = collectionView };
var frame = collectionView.Frame;
await CreateHandlerAndAddToWindow<IWindowHandler>(contentPage,
async (_) =>
{
await WaitForUIUpdate(frame, collectionView);
Assert.True(emptyView.Height > 0, "EmptyView should be laid out");
Assert.True(header.Height > 0, "Header should be laid out");
Assert.True(footer.Height > 0, "Footer should be laid out");
});
}
}
}

Просмотреть файл

@ -170,6 +170,66 @@ namespace Microsoft.Maui.DeviceTests
});
}
[Theory]
[InlineData(true, false, false)]
[InlineData(true, false, true)]
[InlineData(true, true, false)]
[InlineData(true, true, true)]
[InlineData(false, false, false)]
[InlineData(false, false, true)]
[InlineData(false, true, false)]
[InlineData(false, true, true)]
public async Task CollectionViewStructuralItems(bool hasHeader, bool hasFooter, bool hasData)
{
SetupBuilder();
double containerHeight = 500;
double containerWidth = 500;
var layout = new Grid() { IgnoreSafeArea = true, HeightRequest = containerHeight, WidthRequest = containerWidth };
Label headerLabel = hasHeader ? new Label { Text = "header" } : null;
Label footerLabel = hasFooter ? new Label { Text = "footer" } : null;
var collectionView = new CollectionView
{
ItemsLayout = LinearItemsLayout.Vertical,
ItemTemplate = new DataTemplate(() => new Label() { HeightRequest = 20, WidthRequest = 20 }),
Header = headerLabel,
Footer = footerLabel,
ItemsSource = hasData ? null : new ObservableCollection<string> { "data" }
};
layout.Add(collectionView);
var frame = collectionView.Frame;
await CreateHandlerAndAddToWindow<LayoutHandler>(layout, async handler =>
{
await WaitForUIUpdate(frame, collectionView);
frame = collectionView.Frame;
#if WINDOWS
// On Windows, the ListView pops in and changes the frame, then actually
// loads in the data, which updates it again. So we need to wait for the second
// update before checking the size
await WaitForUIUpdate(frame, collectionView);
frame = collectionView.Frame;
#endif
if (hasHeader)
{
Assert.True(headerLabel.Height > 0);
Assert.True(headerLabel.Width > 0);
}
if (hasFooter)
{
Assert.True(footerLabel.Height > 0);
Assert.True(footerLabel.Width > 0);
}
});
}
public static IEnumerable<object[]> GenerateLayoutOptionsCombos()
{
var layoutOptions = new LayoutOptions[] { LayoutOptions.Center, LayoutOptions.Start, LayoutOptions.End, LayoutOptions.Fill };

Просмотреть файл

@ -9,18 +9,18 @@ namespace Microsoft.Maui.DeviceTests
[Collection(ControlsHandlerTestBase.RunInNewWindowCollection)]
public partial class EditorTests
{
AppCompatEditText GetPlatformControl(EditorHandler handler) =>
static AppCompatEditText GetPlatformControl(EditorHandler handler) =>
handler.PlatformView;
Task<string> GetPlatformText(EditorHandler handler)
static Task<string> GetPlatformText(EditorHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text);
}
void SetPlatformText(EditorHandler editorHandler, string text) =>
static void SetPlatformText(EditorHandler editorHandler, string text) =>
GetPlatformControl(editorHandler).SetTextKeepState(text);
int GetPlatformCursorPosition(EditorHandler editorHandler)
static int GetPlatformCursorPosition(EditorHandler editorHandler)
{
var textView = GetPlatformControl(editorHandler);
@ -30,7 +30,7 @@ namespace Microsoft.Maui.DeviceTests
return -1;
}
int GetPlatformSelectionLength(EditorHandler editorHandler)
static int GetPlatformSelectionLength(EditorHandler editorHandler)
{
var textView = GetPlatformControl(editorHandler);

Просмотреть файл

@ -7,21 +7,21 @@ namespace Microsoft.Maui.DeviceTests
{
public partial class EditorTests
{
TextBox GetPlatformControl(EditorHandler handler) =>
static TextBox GetPlatformControl(EditorHandler handler) =>
handler.PlatformView;
Task<string> GetPlatformText(EditorHandler handler)
static Task<string> GetPlatformText(EditorHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text);
}
void SetPlatformText(EditorHandler editorHandler, string text) =>
static void SetPlatformText(EditorHandler editorHandler, string text) =>
GetPlatformControl(editorHandler).Text = text;
int GetPlatformCursorPosition(EditorHandler editorHandler) =>
static int GetPlatformCursorPosition(EditorHandler editorHandler) =>
GetPlatformControl(editorHandler).SelectionStart;
int GetPlatformSelectionLength(EditorHandler editorHandler) =>
static int GetPlatformSelectionLength(EditorHandler editorHandler) =>
GetPlatformControl(editorHandler).SelectionLength;
}
}

Просмотреть файл

@ -10,7 +10,6 @@ namespace Microsoft.Maui.DeviceTests
[Category(TestCategory.Editor)]
public partial class EditorTests : ControlsHandlerTestBase
{
#if !IOS && !MACCATALYST
// iOS is broken until this point
// https://github.com/dotnet/maui/issues/3425
@ -51,26 +50,6 @@ namespace Microsoft.Maui.DeviceTests
}
#endif
[Theory(DisplayName = "Text is Transformed Correctly at Initialization")]
[ClassData(typeof(TextTransformCases))]
public async Task InitialTextTransformApplied(string text, TextTransform transform, string expected)
{
var control = new Editor() { Text = text, TextTransform = transform };
var platformText = await GetPlatformText(await CreateHandlerAsync<EditorHandler>(control));
Assert.Equal(expected, platformText);
}
[Theory(DisplayName = "Text is Transformed Correctly after Initialization")]
[ClassData(typeof(TextTransformCases))]
public async Task TextTransformUpdated(string text, TextTransform transform, string expected)
{
var control = new Editor() { Text = text };
var handler = await CreateHandlerAsync<EditorHandler>(control);
await InvokeOnMainThreadAsync(() => control.TextTransform = transform);
var platformText = await GetPlatformText(handler);
Assert.Equal(expected, platformText);
}
#if WINDOWS
// Only Windows needs the IsReadOnly workaround for MaxLength==0 to prevent text from being entered
[Fact]
@ -96,198 +75,26 @@ namespace Microsoft.Maui.DeviceTests
}
#endif
[Theory(DisplayName = "CursorPosition Initializes Correctly")]
[InlineData(2)]
public async Task CursorPositionInitializesCorrectly(int initialPosition)
[Category(TestCategory.Editor)]
[Category(TestCategory.TextInput)]
[Collection(RunInNewWindowCollection)]
public class EditorTextInputTests : TextInputTests<EditorHandler, Editor>
{
var editor = new Editor
{
Text = "This is TEXT!",
CursorPosition = initialPosition
};
protected override int GetPlatformSelectionLength(EditorHandler handler) =>
EditorTests.GetPlatformSelectionLength(handler);
await ValidatePropertyInitValue<int, EditorHandler>(
editor,
() => editor.CursorPosition,
GetPlatformCursorPosition,
initialPosition);
protected override int GetPlatformCursorPosition(EditorHandler handler) =>
EditorTests.GetPlatformCursorPosition(handler);
protected override Task<string> GetPlatformText(EditorHandler handler) =>
EditorTests.GetPlatformText(handler);
}
[Theory(DisplayName = "CursorPosition Updates Correctly")]
[InlineData(2, 5)]
public async Task CursorPositionUpdatesCorrectly(int setValue, int unsetValue)
[Category(TestCategory.Editor)]
[Category(TestCategory.TextInput)]
[Collection(RunInNewWindowCollection)]
public class EditorTextInputFocusTests : TextInputFocusTests<EditorHandler, Editor>
{
string text = "This is TEXT!";
var editor = new Editor
{
Text = text
};
await ValidatePropertyUpdatesValue<int, EditorHandler>(
editor,
nameof(ITextInput.CursorPosition),
GetPlatformCursorPosition,
setValue,
unsetValue
);
}
[Theory(DisplayName = "CursorPosition is Capped to Text's Length")]
[InlineData(30)]
public async Task CursorPositionIsCapped(int initialPosition)
{
string text = "This is TEXT!";
var editor = new Editor
{
Text = text,
CursorPosition = initialPosition
};
await ValidatePropertyInitValue<int, EditorHandler>(
editor,
() => editor.CursorPosition,
GetPlatformCursorPosition,
text.Length);
}
[Theory(DisplayName = "Unset CursorPosition is kept at zero at initialization")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task UnsetCursorPositionKeepsToZeroOnInitialization(string text)
{
var editor = new Editor
{
Text = text
};
await ValidatePropertyInitValue<int, EditorHandler>(
editor,
() => editor.CursorPosition,
GetPlatformCursorPosition,
0);
}
[Theory(DisplayName = "CursorPosition moves to the end on text change after initialization"
#if WINDOWS
, Skip = "For some reason, the PlatformView events are not being fired on tests after the handler is created, something is swallowing them. " +
"This was tested on a real app and it's working correctly."
#endif
)]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task CursorPositionMovesToTheEndOnTextChangeAfterInitialization(string text)
{
var editor = new Editor
{
Text = "Test"
};
await SetValueAsync<string, EditorHandler>(editor, text, (h, s) => h.VirtualView.Text = s);
Assert.Equal(text.Length, editor.CursorPosition);
}
[Theory(DisplayName = "SelectionLength Initializes Correctly")]
[InlineData(2)]
public async Task SelectionLengthInitializesCorrectly(int initialLength)
{
var editor = new Editor
{
Text = "This is TEXT!",
SelectionLength = initialLength
};
await ValidatePropertyInitValue<int, EditorHandler>(
editor,
() => editor.SelectionLength,
GetPlatformSelectionLength,
initialLength);
}
[Theory(DisplayName = "SelectionLength Updates Correctly")]
[InlineData(2, 5)]
public async Task SelectionLengthUpdatesCorrectly(int setValue, int unsetValue)
{
string text = "This is TEXT!";
var editor = new Editor
{
Text = text,
};
await ValidatePropertyUpdatesValue<int, EditorHandler>(
editor,
nameof(IEditor.SelectionLength),
GetPlatformSelectionLength,
setValue,
unsetValue
);
}
[Theory(DisplayName = "SelectionLength is Capped to Text Length")]
[InlineData(30)]
public async Task SelectionLengthIsCapped(int selectionLength)
{
string text = "This is TEXT!";
var editor = new Editor
{
Text = text,
SelectionLength = selectionLength
};
await ValidatePropertyInitValue<int, EditorHandler>(
editor,
() => editor.SelectionLength,
GetPlatformSelectionLength,
text.Length);
}
[Theory(DisplayName = "Unset SelectionLength is kept at zero at initialization")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task UnsetSelectionLengthKeepsToZeroOnInitialization(string text)
{
var editor = new Editor
{
Text = text
};
await ValidatePropertyInitValue<int, EditorHandler>(
editor,
() => editor.SelectionLength,
GetPlatformSelectionLength,
0);
}
[Theory(DisplayName = "SelectionLength is kept at zero on text change after initialization"
#if WINDOWS
, Skip = "For some reason, the PlatformView events are not being fired on tests after the handler is created, something is swallowing them. " +
"This was tested on a real app and it's working correctly."
#endif
)]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task SelectionLengthMovesToTheEndOnTextChangeAfterInitialization(string text)
{
var editor = new Editor
{
Text = "Test"
};
await SetValueAsync<string, EditorHandler>(editor, text, (h, s) => h.VirtualView.Text = s);
Assert.Equal(0, editor.SelectionLength);
}
}
}

Просмотреть файл

@ -8,18 +8,18 @@ namespace Microsoft.Maui.DeviceTests
[Collection(ControlsHandlerTestBase.RunInNewWindowCollection)]
public partial class EditorTests
{
MauiTextView GetPlatformControl(EditorHandler handler) =>
static MauiTextView GetPlatformControl(EditorHandler handler) =>
handler.PlatformView;
Task<string> GetPlatformText(EditorHandler handler)
static Task<string> GetPlatformText(EditorHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text);
}
void SetPlatformText(EditorHandler editorHandler, string text) =>
static void SetPlatformText(EditorHandler editorHandler, string text) =>
GetPlatformControl(editorHandler).Text = text;
int GetPlatformCursorPosition(EditorHandler editorHandler)
static int GetPlatformCursorPosition(EditorHandler editorHandler)
{
var nativeEditor = GetPlatformControl(editorHandler);
@ -29,7 +29,7 @@ namespace Microsoft.Maui.DeviceTests
return -1;
}
int GetPlatformSelectionLength(EditorHandler editorHandler)
static int GetPlatformSelectionLength(EditorHandler editorHandler)
{
var nativeEditor = GetPlatformControl(editorHandler);

Просмотреть файл

@ -9,18 +9,18 @@ namespace Microsoft.Maui.DeviceTests
{
public partial class EntryTests
{
AppCompatEditText GetPlatformControl(EntryHandler handler) =>
static AppCompatEditText GetPlatformControl(EntryHandler handler) =>
handler.PlatformView;
Task<string> GetPlatformText(EntryHandler handler)
static Task<string> GetPlatformText(EntryHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text);
}
void SetPlatformText(EntryHandler entryHandler, string text) =>
static void SetPlatformText(EntryHandler entryHandler, string text) =>
GetPlatformControl(entryHandler).SetTextKeepState(text);
int GetPlatformCursorPosition(EntryHandler entryHandler)
static int GetPlatformCursorPosition(EntryHandler entryHandler)
{
var editText = GetPlatformControl(entryHandler);
@ -30,7 +30,7 @@ namespace Microsoft.Maui.DeviceTests
return -1;
}
int GetPlatformSelectionLength(EntryHandler entryHandler)
static int GetPlatformSelectionLength(EntryHandler entryHandler)
{
var editText = GetPlatformControl(entryHandler);

Просмотреть файл

@ -7,21 +7,21 @@ namespace Microsoft.Maui.DeviceTests
{
public partial class EntryTests
{
TextBox GetPlatformControl(EntryHandler handler) =>
static TextBox GetPlatformControl(EntryHandler handler) =>
handler.PlatformView;
Task<string> GetPlatformText(EntryHandler handler)
static Task<string> GetPlatformText(EntryHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text);
}
void SetPlatformText(EntryHandler entryHandler, string text) =>
static void SetPlatformText(EntryHandler entryHandler, string text) =>
GetPlatformControl(entryHandler).Text = text;
int GetPlatformCursorPosition(EntryHandler entryHandler) =>
static int GetPlatformCursorPosition(EntryHandler entryHandler) =>
GetPlatformControl(entryHandler).SelectionStart;
int GetPlatformSelectionLength(EntryHandler entryHandler) =>
static int GetPlatformSelectionLength(EntryHandler entryHandler) =>
GetPlatformControl(entryHandler).SelectionLength;
}
}

Просмотреть файл

@ -12,26 +12,6 @@ namespace Microsoft.Maui.DeviceTests
[Category(TestCategory.Entry)]
public partial class EntryTests : ControlsHandlerTestBase
{
[Theory(DisplayName = "Text is Transformed Correctly at Initialization")]
[ClassData(typeof(TextTransformCases))]
public async Task InitialTextTransformApplied(string text, TextTransform transform, string expected)
{
var control = new Entry() { Text = text, TextTransform = transform };
var platformText = await GetPlatformText(await CreateHandlerAsync<EntryHandler>(control));
Assert.Equal(expected, platformText);
}
[Theory(DisplayName = "Text is Transformed Correctly after Initialization")]
[ClassData(typeof(TextTransformCases))]
public async Task TextTransformUpdated(string text, TextTransform transform, string expected)
{
var control = new Entry() { Text = text };
var handler = await CreateHandlerAsync<EntryHandler>(control);
await InvokeOnMainThreadAsync(() => control.TextTransform = transform);
var platformText = await GetPlatformText(handler);
Assert.Equal(expected, platformText);
}
[Fact]
public async Task MaxLengthTrims()
{
@ -138,198 +118,26 @@ namespace Microsoft.Maui.DeviceTests
}
#endif
[Theory(DisplayName = "CursorPosition Initializes Correctly")]
[InlineData(2)]
public async Task CursorPositionInitializesCorrectly(int initialPosition)
[Category(TestCategory.Entry)]
[Category(TestCategory.TextInput)]
[Collection(RunInNewWindowCollection)]
public class EntryTextInputTests : TextInputTests<EntryHandler, Entry>
{
var entry = new Entry
{
Text = "This is TEXT!",
CursorPosition = initialPosition
};
protected override int GetPlatformSelectionLength(EntryHandler handler) =>
EntryTests.GetPlatformSelectionLength(handler);
await ValidatePropertyInitValue<int, EntryHandler>(
entry,
() => entry.CursorPosition,
GetPlatformCursorPosition,
initialPosition);
protected override int GetPlatformCursorPosition(EntryHandler handler) =>
EntryTests.GetPlatformCursorPosition(handler);
protected override Task<string> GetPlatformText(EntryHandler handler) =>
EntryTests.GetPlatformText(handler);
}
[Theory(DisplayName = "CursorPosition Updates Correctly")]
[InlineData(2, 5)]
public async Task CursorPositionUpdatesCorrectly(int setValue, int unsetValue)
[Category(TestCategory.Entry)]
[Category(TestCategory.TextInput)]
[Collection(RunInNewWindowCollection)]
public class EntryTextInputFocusTests : TextInputFocusTests<EntryHandler, Entry>
{
string text = "This is TEXT!";
var entry = new Entry
{
Text = text
};
await ValidatePropertyUpdatesValue<int, EntryHandler>(
entry,
nameof(ITextInput.CursorPosition),
GetPlatformCursorPosition,
setValue,
unsetValue
);
}
[Theory(DisplayName = "CursorPosition is Capped to Text's Length")]
[InlineData(30)]
public async Task CursorPositionIsCapped(int initialPosition)
{
string text = "This is TEXT!";
var entry = new Entry
{
Text = text,
CursorPosition = initialPosition
};
await ValidatePropertyInitValue<int, EntryHandler>(
entry,
() => entry.CursorPosition,
GetPlatformCursorPosition,
text.Length);
}
[Theory(DisplayName = "Unset CursorPosition is kept at zero at initialization")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task UnsetCursorPositionIsKeptAtZeroAtInitialization(string text)
{
var entry = new Entry
{
Text = text
};
await ValidatePropertyInitValue<int, EntryHandler>(
entry,
() => entry.CursorPosition,
GetPlatformCursorPosition,
0);
}
[Theory(DisplayName = "CursorPosition moves to the end on text change by code after initialization"
#if WINDOWS
, Skip = "For some reason, the PlatformView events are not being fired on tests after the handler is created, something is swallowing them. " +
"This was tested on a real app and it's working correctly."
#endif
)]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task CursorPositionMovesToTheEndOnTextChangeAfterInitialization(string text)
{
var entry = new Entry
{
Text = "Test"
};
await SetValueAsync<string, EntryHandler>(entry, text, (h, s) => h.VirtualView.Text = s);
Assert.Equal(text.Length, entry.CursorPosition);
}
[Theory(DisplayName = "SelectionLength Initializes Correctly")]
[InlineData(2)]
public async Task SelectionLengthInitializesCorrectly(int initialLength)
{
var entry = new Entry
{
Text = "This is TEXT!",
SelectionLength = initialLength
};
await ValidatePropertyInitValue<int, EntryHandler>(
entry,
() => entry.SelectionLength,
GetPlatformSelectionLength,
initialLength);
}
[Theory(DisplayName = "SelectionLength Updates Correctly")]
[InlineData(2, 5)]
public async Task SelectionLengthUpdatesCorrectly(int setValue, int unsetValue)
{
string text = "This is TEXT!";
var entry = new Entry
{
Text = text,
};
await ValidatePropertyUpdatesValue<int, EntryHandler>(
entry,
nameof(IEntry.SelectionLength),
GetPlatformSelectionLength,
setValue,
unsetValue
);
}
[Theory(DisplayName = "SelectionLength is Capped to Text Length")]
[InlineData(30)]
public async Task SelectionLengthIsCapped(int selectionLength)
{
string text = "This is TEXT!";
var entry = new Entry
{
Text = text,
SelectionLength = selectionLength
};
await ValidatePropertyInitValue<int, EntryHandler>(
entry,
() => entry.SelectionLength,
GetPlatformSelectionLength,
text.Length);
}
[Theory(DisplayName = "Unset SelectionLength is kept at zero at initialization")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task UnsetSelectionLengthIsKeptAtZeroAtInitialization(string text)
{
var entry = new Entry
{
Text = text
};
await ValidatePropertyInitValue<int, EntryHandler>(
entry,
() => entry.SelectionLength,
GetPlatformSelectionLength,
0);
}
[Theory(DisplayName = "SelectionLength is kept at zero on text change by code after initialization"
#if WINDOWS
, Skip = "For some reason, the PlatformView events are not being fired on tests after the handler is created, something is swallowing them. " +
"This was tested on a real app and it's working correctly."
#endif
)]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task SelectionLengthMovesToTheEndOnTextChangeAfterInitialization(string text)
{
var entry = new Entry
{
Text = "Test"
};
await SetValueAsync<string, EntryHandler>(entry, text, (h, s) => h.VirtualView.Text = s);
Assert.Equal(0, entry.SelectionLength);
}
}
}

Просмотреть файл

@ -13,18 +13,18 @@ namespace Microsoft.Maui.DeviceTests
{
public partial class EntryTests
{
UITextField GetPlatformControl(EntryHandler handler) =>
static UITextField GetPlatformControl(EntryHandler handler) =>
(UITextField)handler.PlatformView;
Task<string> GetPlatformText(EntryHandler handler)
static Task<string> GetPlatformText(EntryHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text);
}
void SetPlatformText(EntryHandler entryHandler, string text) =>
static void SetPlatformText(EntryHandler entryHandler, string text) =>
GetPlatformControl(entryHandler).Text = text;
int GetPlatformCursorPosition(EntryHandler entryHandler)
static int GetPlatformCursorPosition(EntryHandler entryHandler)
{
var textField = GetPlatformControl(entryHandler);
@ -34,7 +34,7 @@ namespace Microsoft.Maui.DeviceTests
return -1;
}
int GetPlatformSelectionLength(EntryHandler entryHandler)
static int GetPlatformSelectionLength(EntryHandler entryHandler)
{
var textField = GetPlatformControl(entryHandler);

Просмотреть файл

@ -0,0 +1,44 @@
using System;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Hosting;
using Xunit;
namespace Microsoft.Maui.DeviceTests
{
public partial class PageTests : ControlsHandlerTestBase
{
void SetupBuilder()
{
EnsureHandlerCreated(builder =>
{
builder.ConfigureMauiHandlers(handlers =>
{
SetupShellHandlers(handlers);
});
});
}
[Fact("SafeAreaInset Property is Set")]
public async Task SafeAreaInsetIsSet()
{
SetupBuilder();
var page = new ContentPage { Background = Colors.Blue };
var shell = new Shell() { CurrentItem = page };
await CreateHandlerAndAddToWindow<IWindowHandler>(shell, (handler) =>
{
if (handler.VirtualView is Window window && window.Page is Shell shellPage)
{
Assert.NotEqual(shellPage.CurrentPage.On<iOS>().SafeAreaInsets(), Thickness.Zero);
}
});
}
}
}

Просмотреть файл

@ -1,21 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using Android.Widget;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;
using SearchView = AndroidX.AppCompat.Widget.SearchView;
namespace Microsoft.Maui.DeviceTests
{
public partial class SearchBarTests
{
SearchView GetPlatformControl(SearchBarHandler handler) =>
static SearchView GetPlatformControl(SearchBarHandler handler) =>
handler.PlatformView;
Task<string> GetPlatformText(SearchBarHandler handler)
static Task<string> GetPlatformText(SearchBarHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Query);
}
static int GetPlatformSelectionLength(SearchBarHandler searchBarHandler)
{
var control = GetPlatformControl(searchBarHandler);
var editText = control.GetChildrenOfType<EditText>().FirstOrDefault();
return editText.SelectionEnd - editText.SelectionStart;
}
static int GetPlatformCursorPosition(SearchBarHandler searchBarHandler)
{
var control = GetPlatformControl(searchBarHandler);
var editText = control.GetChildrenOfType<EditText>().FirstOrDefault();
return editText.SelectionStart;
}
}
}

Просмотреть файл

@ -1,18 +1,47 @@
#nullable enable
using System.Threading.Tasks;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Platform;
using Microsoft.UI.Xaml.Controls;
namespace Microsoft.Maui.DeviceTests
{
public partial class SearchBarTests
{
AutoSuggestBox GetPlatformControl(SearchBarHandler handler) =>
static AutoSuggestBox GetPlatformControl(SearchBarHandler handler) =>
handler.PlatformView;
Task<string> GetPlatformText(SearchBarHandler handler)
static Task<string> GetPlatformText(SearchBarHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text);
}
static int GetPlatformSelectionLength(SearchBarHandler searchBarHandler)
{
var platformSearchBar = GetPlatformControl(searchBarHandler);
var textBox = platformSearchBar.GetFirstDescendant<TextBox>();
if (textBox is not null)
{
return textBox.SelectionLength;
}
return -1;
}
static int GetPlatformCursorPosition(SearchBarHandler searchBarHandler)
{
var platformSearchBar = GetPlatformControl(searchBarHandler);
var textBox = platformSearchBar.GetFirstDescendant<TextBox>();
if (textBox is not null)
{
return textBox.SelectionStart;
}
return -1;
}
}
}

Просмотреть файл

@ -10,7 +10,9 @@ namespace Microsoft.Maui.DeviceTests
[Category(TestCategory.SearchBar)]
public partial class SearchBarTests : ControlsHandlerTestBase
{
[Theory]
// TODO: remove these 2 tests and use SearchBarTextInputTests below
[Theory(DisplayName = "Text is Transformed Correctly at Initialization")]
[ClassData(typeof(TextTransformCases))]
public async Task InitialTextTransformApplied(string text, TextTransform transform, string expected)
{
@ -19,7 +21,7 @@ namespace Microsoft.Maui.DeviceTests
Assert.Equal(expected, platformText);
}
[Theory]
[Theory(DisplayName = "Text is Transformed Correctly after Initialization")]
[ClassData(typeof(TextTransformCases))]
public async Task TextTransformUpdated(string text, TextTransform transform, string expected)
{
@ -54,5 +56,30 @@ namespace Microsoft.Maui.DeviceTests
});
}
#endif
#if false
// TODO: The search bar controls are composite controls and need to be attached to the UI to run
[Category(TestCategory.SearchBar)]
[Category(TestCategory.TextInput)]
[Collection(RunInNewWindowCollection)]
public class SearchBarTextInputTests : TextInputTests<SearchBarHandler, SearchBar>
{
protected override int GetPlatformSelectionLength(SearchBarHandler handler) =>
SearchBarTests.GetPlatformSelectionLength(handler);
protected override int GetPlatformCursorPosition(SearchBarHandler handler) =>
SearchBarTests.GetPlatformCursorPosition(handler);
protected override Task<string> GetPlatformText(SearchBarHandler handler) =>
SearchBarTests.GetPlatformText(handler);
}
#endif
[Category(TestCategory.SearchBar)]
[Category(TestCategory.TextInput)]
[Collection(RunInNewWindowCollection)]
public class SearchBarTextInputFocusTests : TextInputFocusTests<SearchBarHandler, SearchBar>
{
}
}
}

Просмотреть файл

@ -6,12 +6,24 @@ namespace Microsoft.Maui.DeviceTests
{
public partial class SearchBarTests
{
MauiSearchBar GetPlatformControl(SearchBarHandler handler) =>
static MauiSearchBar GetPlatformControl(SearchBarHandler handler) =>
handler.PlatformView;
Task<string> GetPlatformText(SearchBarHandler handler)
static Task<string> GetPlatformText(SearchBarHandler handler)
{
return InvokeOnMainThreadAsync(() => GetPlatformControl(handler).Text);
}
static int GetPlatformSelectionLength(SearchBarHandler searchBarHandler)
{
var control = searchBarHandler.QueryEditor;
return control.GetSelectedTextLength();
}
static int GetPlatformCursorPosition(SearchBarHandler searchBarHandler)
{
var control = searchBarHandler.QueryEditor;
return control.GetCursorPosition();
}
}
}

Просмотреть файл

@ -6,39 +6,37 @@ using Xunit;
namespace Microsoft.Maui.DeviceTests
{
[Category(TestCategory.TextInput)]
[Collection(RunInNewWindowCollection)]
public partial class TextInputTests
public abstract partial class TextInputFocusTests<THandler, TView> : ControlsHandlerTestBase
where THandler : class, IViewHandler, IPlatformViewHandler, new()
where TView : VisualElement, ITextInput, new()
{
[Theory]
[InlineData(typeof(Editor))]
[InlineData(typeof(Entry))]
[InlineData(typeof(SearchBar))]
public async Task ShowsKeyboardOnFocus(Type controlType)
[Fact]
public async Task ShowsKeyboardOnFocus()
{
SetupBuilder();
var textInput = (View)Activator.CreateInstance(controlType);
var textInput = new TView() as VisualElement;
textInput.HeightRequest = 100;
textInput.WidthRequest = 100;
await AttachAndRun(textInput, async (handler) =>
await AttachAndRun<THandler>(textInput, async (handler) =>
{
try
{
var platformView = handler.PlatformView;
await AssertionExtensions.HideKeyboardForView(textInput, message: $"Make sure keyboard starts out closed {controlType}");
await AssertionExtensions.HideKeyboardForView(textInput, message: $"Make sure keyboard starts out closed");
textInput.Focus();
await AssertionExtensions.WaitForFocused(platformView, message: $"WaitForFocused failed after first focus on {controlType}");
await AssertionExtensions.WaitForKeyboardToShow(platformView, message: $"WaitForKeyboardToShow failed after first focus on {controlType}");
await AssertionExtensions.WaitForFocused(platformView, message: $"WaitForFocused failed after first focus");
await AssertionExtensions.WaitForKeyboardToShow(platformView, message: $"WaitForKeyboardToShow failed after first focus");
// Test that keyboard reappears when refocusing on an already focused TextInput control
await AssertionExtensions.HideKeyboardForView(textInput, message: $"HideKeyboardForView failed after first keyboard show on {controlType}");
await AssertionExtensions.HideKeyboardForView(textInput, message: $"HideKeyboardForView failed after first keyboard show");
textInput.Focus();
await AssertionExtensions.WaitForFocused(platformView, message: $"WaitForFocused failed after second focus on {controlType}");
await AssertionExtensions.WaitForKeyboardToShow(platformView, message: $"WaitForKeyboardToShow failed after second focus on {controlType}");
await AssertionExtensions.WaitForFocused(platformView, message: $"WaitForFocused failed after second focus");
await AssertionExtensions.WaitForKeyboardToShow(platformView, message: $"WaitForKeyboardToShow failed after second focus");
}
finally
{
await AssertionExtensions.HideKeyboardForView(textInput, message: $"HideKeyboardForView after test has finished {controlType}");
await AssertionExtensions.HideKeyboardForView(textInput, message: $"HideKeyboardForView after test has finished");
}
});
}

Просмотреть файл

@ -0,0 +1,12 @@
using Microsoft.Maui.Controls;
using Xunit;
namespace Microsoft.Maui.DeviceTests
{
[Category(TestCategory.TextInput)]
public abstract partial class TextInputFocusTests<THandler, TView> : ControlsHandlerTestBase
where THandler : class, IViewHandler, IPlatformViewHandler, new()
where TView : VisualElement, ITextInput, new()
{
}
}

Просмотреть файл

@ -1,24 +1,338 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Hosting;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Xunit;
namespace Microsoft.Maui.DeviceTests
{
[Category(TestCategory.TextInput)]
public partial class TextInputTests : ControlsHandlerTestBase
public abstract partial class TextInputTests<THandler, TView> : ControlsHandlerTestBase
where THandler : class, IViewHandler, IPlatformViewHandler, new()
where TView : InputView, IView, ITextInput, new()
{
void SetupBuilder()
protected abstract int GetPlatformCursorPosition(THandler handler);
protected abstract int GetPlatformSelectionLength(THandler handler);
protected abstract Task<string> GetPlatformText(THandler handler);
[Theory(DisplayName = "Text is Transformed Correctly at Initialization")]
[ClassData(typeof(TextTransformCases))]
public async Task InitialTextTransformApplied(string text, TextTransform transform, string expected)
{
EnsureHandlerCreated(builder =>
var control = new TView() { Text = text, TextTransform = transform };
var platformText = await GetPlatformText(await CreateHandlerAsync<THandler>(control));
Assert.Equal(expected, platformText);
}
[Theory(DisplayName = "Text is Transformed Correctly after Initialization")]
[ClassData(typeof(TextTransformCases))]
public async Task TextTransformUpdated(string text, TextTransform transform, string expected)
{
var control = new TView() { Text = text };
var handler = await CreateHandlerAsync<THandler>(control);
await InvokeOnMainThreadAsync(() => control.TextTransform = transform);
var platformText = await GetPlatformText(handler);
Assert.Equal(expected, platformText);
}
[Theory(DisplayName = "Unset CursorPosition is kept at zero at initialization with TextTransform")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task UnsetCursorPositionKeepsToZeroOnInitializationWithTextTransform(string text)
{
var control = new TView
{
builder.ConfigureMauiHandlers(handlers =>
{
handlers.AddHandler<Entry, EntryHandler>();
handlers.AddHandler<Editor, EditorHandler>();
handlers.AddHandler<SearchBar, SearchBarHandler>();
});
Text = text,
TextTransform = TextTransform.Uppercase
};
await ValidatePropertyInitValue<int, THandler>(
control,
() => control.CursorPosition,
GetPlatformCursorPosition,
0);
}
[Theory(DisplayName = "Unset SelectionLength is kept at zero at initialization with TextTransform")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task UnsetSelectionLengthKeepsToZeroOnInitializationWithTextTransform(string text)
{
var control = new TView
{
Text = text,
TextTransform = TextTransform.Uppercase
};
await ValidatePropertyInitValue<int, THandler>(
control,
() => control.SelectionLength,
GetPlatformSelectionLength,
0);
}
[Theory(DisplayName = "CursorPosition Initializes Correctly")]
[InlineData(2)]
public async Task CursorPositionInitializesCorrectly(int initialPosition)
{
var control = new TView
{
Text = "This is TEXT!",
CursorPosition = initialPosition
};
await ValidatePropertyInitValue<int, THandler>(
control,
() => control.CursorPosition,
GetPlatformCursorPosition,
initialPosition);
}
[Theory]
[InlineData(2)]
public async Task CursorPositionInitializesCorrectlyWithUpdateCursorPositionLast(int initialPosition)
{
var control = new TView
{
Text = "This is TEXT!",
CursorPosition = initialPosition
};
var value = await GetValueAsync<int, THandler>(control, handler =>
{
handler.UpdateValue(nameof(ITextInput.CursorPosition));
return GetPlatformCursorPosition(handler);
});
Assert.Equal(initialPosition, value);
}
[Theory]
[InlineData(2)]
public async Task CursorPositionInitializesCorrectlyWithUpdateTextLast(int initialPosition)
{
var control = new TView
{
Text = "This is TEXT!",
CursorPosition = initialPosition
};
var value = await GetValueAsync<int, THandler>(control, handler =>
{
handler.UpdateValue(nameof(ITextInput.Text));
return GetPlatformCursorPosition(handler);
});
Assert.Equal(initialPosition, value);
}
[Theory(DisplayName = "SelectionLength Initializes Correctly")]
[InlineData(2)]
public async Task SelectionLengthInitializesCorrectly(int initialLength)
{
var control = new TView
{
Text = "This is TEXT!",
SelectionLength = initialLength
};
await ValidatePropertyInitValue<int, THandler>(
control,
() => control.SelectionLength,
GetPlatformSelectionLength,
initialLength);
}
[Theory]
[InlineData(2)]
public async Task SelectionLengthInitializesCorrectlyWithUpdateCursorPositionLast(int initialLength)
{
var control = new TView
{
Text = "This is TEXT!",
SelectionLength = initialLength
};
var value = await GetValueAsync<int, THandler>(control, handler =>
{
handler.UpdateValue(nameof(ITextInput.CursorPosition));
return GetPlatformSelectionLength(handler);
});
Assert.Equal(initialLength, value);
}
[Theory]
[InlineData(2)]
public async Task SelectionLengthInitializesCorrectlyWithUpdateTextLast(int initialLength)
{
var control = new TView
{
Text = "This is TEXT!",
SelectionLength = initialLength
};
var value = await GetValueAsync<int, THandler>(control, handler =>
{
handler.UpdateValue(nameof(ITextInput.Text));
return GetPlatformSelectionLength(handler);
});
Assert.Equal(initialLength, value);
}
[Theory(DisplayName = "CursorPosition Updates Correctly")]
[InlineData(2, 5)]
public async Task CursorPositionUpdatesCorrectly(int setValue, int unsetValue)
{
string text = "This is TEXT!";
var control = new TView
{
Text = text
};
await ValidatePropertyUpdatesValue<int, THandler>(
control,
nameof(ITextInput.CursorPosition),
GetPlatformCursorPosition,
setValue,
unsetValue
);
}
[Theory(DisplayName = "CursorPosition is Capped to Text's Length")]
[InlineData(30)]
public async Task CursorPositionIsCapped(int initialPosition)
{
string text = "This is TEXT!";
var control = new TView
{
Text = text,
CursorPosition = initialPosition
};
await ValidatePropertyInitValue<int, THandler>(
control,
() => control.CursorPosition,
GetPlatformCursorPosition,
text.Length);
}
[Theory(DisplayName = "Unset CursorPosition is kept at zero at initialization")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task UnsetCursorPositionKeepsToZeroOnInitialization(string text)
{
var control = new TView
{
Text = text
};
await ValidatePropertyInitValue<int, THandler>(
control,
() => control.CursorPosition,
GetPlatformCursorPosition,
0);
}
[Theory(DisplayName = "CursorPosition moves to the end on text change after initialization")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task CursorPositionMovesToTheEndOnTextChangeAfterInitialization(string text)
{
var control = new TView
{
Text = "Test"
};
await AttachAndRunFocusAffectedControl<TView, THandler>(control, handler => control.Text = text);
Assert.Equal(text.Length, control.CursorPosition);
}
[Theory(DisplayName = "SelectionLength Updates Correctly")]
[InlineData(2, 5)]
public async Task SelectionLengthUpdatesCorrectly(int setValue, int unsetValue)
{
string text = "This is TEXT!";
var control = new TView
{
Text = text,
};
await ValidatePropertyUpdatesValue<int, THandler>(
control,
nameof(ITextInput.SelectionLength),
GetPlatformSelectionLength,
setValue,
unsetValue
);
}
[Theory(DisplayName = "SelectionLength is Capped to Text Length")]
[InlineData(30)]
public async Task SelectionLengthIsCapped(int selectionLength)
{
string text = "This is TEXT!";
var control = new TView
{
Text = text,
SelectionLength = selectionLength
};
await ValidatePropertyInitValue<int, THandler>(
control,
() => control.SelectionLength,
GetPlatformSelectionLength,
text.Length);
}
[Theory(DisplayName = "Unset SelectionLength is kept at zero at initialization")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task UnsetSelectionLengthKeepsToZeroOnInitialization(string text)
{
var control = new TView
{
Text = text
};
await ValidatePropertyInitValue<int, THandler>(
control,
() => control.SelectionLength,
GetPlatformSelectionLength,
0);
}
[Theory(DisplayName = "SelectionLength is kept at zero on text change after initialization")]
[InlineData("This is a test!!!")]
[InlineData("a")]
[InlineData("")]
[InlineData(" ")]
public async Task SelectionLengthKeepsToZeroOnTextChangeAfterInitialization(string text)
{
var control = new TView
{
Text = "Test"
};
await AttachAndRunFocusAffectedControl<TView, THandler>(control, handler => control.Text = text);
Assert.Equal(0, control.SelectionLength);
}
}
}

Просмотреть файл

@ -0,0 +1,129 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers;
using Microsoft.Maui.DeviceTests.Stubs;
using Microsoft.Maui.DeviceTests.TestCases;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.Platform;
using Microsoft.UI.Xaml.Controls;
using Xunit;
using Xunit.Sdk;
namespace Microsoft.Maui.DeviceTests
{
[Category(TestCategory.Toolbar)]
public partial class ToolbarTests : ControlsHandlerTestBase
{
[Fact(DisplayName = "Toolbar Default Label Position")]
public async Task ToolbarDefaultLabelPositionWithNoImages()
{
SetupBuilder();
var item1 = new ToolbarItem() { Text = "Toolbar Item 1" };
var item2 = new ToolbarItem() { Text = "Toolbar Item 2" };
var navPage = new NavigationPage(new ContentPage()
{
ToolbarItems =
{
item1,
item2
}
});
await CreateHandlerAndAddToWindow<WindowHandlerStub>(new Window(navPage), (handler) =>
{
var toolbar = (Toolbar)(navPage.Window as IToolbarElement).Toolbar;
var platformCommandBar = ((MauiToolbar)toolbar.Handler.PlatformView).CommandBar;
Assert.True(platformCommandBar.DefaultLabelPosition == CommandBarDefaultLabelPosition.Right);
return Task.CompletedTask;
});
}
[Fact(DisplayName = "Toolbar Default Label Position with Image and Text")]
public async Task ToolbarDefaultLabelPositionWithTextAndImages()
{
SetupBuilder();
var item1 = new ToolbarItem() { IconImageSource = "red.png" };
var item2 = new ToolbarItem() { Text = "Toolbar Item 2" };
var item3 = new ToolbarItem() { Text = "Toolbar Item 2", IconImageSource = "red.png" };
var navPage = new NavigationPage(new ContentPage()
{
ToolbarItems =
{
item1,
item2,
item3
}
});
await CreateHandlerAndAddToWindow<WindowHandlerStub>(new Window(navPage), (handler) =>
{
var toolbar = (Toolbar)(navPage.Window as IToolbarElement).Toolbar;
var platformCommandBar = ((MauiToolbar)toolbar.Handler.PlatformView).CommandBar;
Assert.True(platformCommandBar.DefaultLabelPosition == CommandBarDefaultLabelPosition.Right);
return Task.CompletedTask;
});
}
[Fact(DisplayName = "Toolbar Default Label Position With Images")]
public async Task ToolbarDefaultLabelPositionOnlyImages()
{
SetupBuilder();
var item1 = new ToolbarItem() { IconImageSource = "red.png" };
var item2 = new ToolbarItem() { IconImageSource = "red.png" };
var navPage = new NavigationPage(new ContentPage()
{
ToolbarItems =
{
item1,
item2
}
});
await CreateHandlerAndAddToWindow<WindowHandlerStub>(new Window(navPage), (handler) =>
{
var toolbar = (Toolbar)(navPage.Window as IToolbarElement).Toolbar;
var platformCommandBar = ((MauiToolbar)toolbar.Handler.PlatformView).CommandBar;
Assert.True(platformCommandBar.DefaultLabelPosition == CommandBarDefaultLabelPosition.Collapsed);
return Task.CompletedTask;
});
}
[Fact(DisplayName = "Toolbar Default Label Position Add Text to Images")]
public async Task ToolbarDefaultLabelPositionAddText()
{
SetupBuilder();
var item1 = new ToolbarItem() { IconImageSource = "red.png" };
var item2 = new ToolbarItem() { IconImageSource = "red.png" };
var navPage = new NavigationPage(new ContentPage()
{
ToolbarItems =
{
item1,
item2
}
});
await CreateHandlerAndAddToWindow<WindowHandlerStub>(new Window(navPage), (handler) =>
{
navPage.CurrentPage.ToolbarItems[0].Text = "Toolbar Item 1";
var toolbar = (Toolbar)(navPage.Window as IToolbarElement).Toolbar;
var platformCommandBar = ((MauiToolbar)toolbar.Handler.PlatformView).CommandBar;
Assert.True(platformCommandBar.DefaultLabelPosition == CommandBarDefaultLabelPosition.Right);
return Task.CompletedTask;
});
}
}
}

Просмотреть файл

@ -37,7 +37,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="Xamarin.UITest" Version="4.2.0" />
<PackageReference Include="Xamarin.UITest" Version="4.1.4" />
</ItemGroup>
</Project>

Просмотреть файл

@ -67,7 +67,7 @@ namespace Microsoft.Maui.Controls.Xaml.UnitTests
}
[TestCase(true)]
// [TestCase(false)] TODO: Figure why this tests is failing with NRE on UnApply of the Style
[TestCase(false, Ignore = "This is failing on CI on macOS: https://github.com/dotnet/maui/issues/15054")]
public void FooBz54334(bool useCompiledXaml)
{
var app = Application.Current = new Bz54334App(useCompiledXaml);

Просмотреть файл

@ -0,0 +1,16 @@
namespace Microsoft.Maui
{
/// <summary>
/// Provides functionality for the Page's SafeAreaInsets that may be changed in the future.
/// </summary>
/// <remarks>
/// This interface is only recognized on the iOS/Mac Catalyst platforms; other platforms will ignore it.
/// </remarks>
internal interface ISafeAreaView2
{
/// <summary>
/// Internal property for the Page's SafeAreaInsets Thickness that may be changed in the future.
/// </summary>
internal Thickness SafeAreaInsets { set; }
}
}

Просмотреть файл

@ -15,6 +15,11 @@ namespace Microsoft.Maui
/// </summary>
bool IsTextPredictionEnabled { get; }
/// <summary>
/// Gets a value that controls whether spellchecking is on or off.
/// </summary>
bool IsSpellCheckEnabled { get; }
/// <summary>
/// Gets a value indicating whether or not the view is read-only.
/// </summary>

Просмотреть файл

@ -90,6 +90,9 @@ namespace Microsoft.Maui.Handlers
public static void MapIsTextPredictionEnabled(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateIsTextPredictionEnabled(editor);
public static void MapIsSpellCheckEnabled(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateIsSpellCheckEnabled(editor);
public static void MapFont(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateFont(editor, handler.GetRequiredService<IFontManager>());

Просмотреть файл

@ -12,7 +12,20 @@ namespace Microsoft.Maui.Handlers
public static void MapPlaceholderColor(IViewHandler handler, IEditor editor) { }
public static void MapCharacterSpacing(IViewHandler handler, IEditor editor) { }
public static void MapMaxLength(IViewHandler handler, IEditor editor) { }
/// <summary>
/// Maps the abstract <see cref="ITextInput.IsTextPredictionEnabled"/> property to the platform-specific implementations.
/// </summary>
/// <param name="handler"> The associated handler.</param>
/// <param name="editor"> The associated <see cref="IEditor"/> instance.</param>
public static void MapIsTextPredictionEnabled(IEditorHandler handler, IEditor editor) { }
/// <summary>
/// Maps the abstract <see cref="ITextInput.IsSpellCheckEnabled"/> property to the platform-specific implementations.
/// </summary>
/// <param name="handler"> The associated handler.</param>
/// <param name="editor"> The associated <see cref="IEditor"/> instance.</param>
public static void MapIsSpellCheckEnabled(IEditorHandler handler, IEditor editor) { }
public static void MapFont(IViewHandler handler, IEditor editor) { }
public static void MapIsReadOnly(IViewHandler handler, IEditor editor) { }
public static void MapTextColor(IEditorHandler handler, IEditor editor) { }

Просмотреть файл

@ -94,6 +94,9 @@ namespace Microsoft.Maui.Handlers
public static void MapIsTextPredictionEnabled(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateIsTextPredictionEnabled(editor);
[MissingMapper]
public static void MapIsSpellCheckEnabled(IEditorHandler handler, IEditor editor) { }
public static void MapFont(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateFont(editor, handler.GetRequiredService<IFontManager>());

Просмотреть файл

@ -63,6 +63,9 @@ namespace Microsoft.Maui.Handlers
public static void MapIsTextPredictionEnabled(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateIsTextPredictionEnabled(editor);
public static void MapIsSpellCheckEnabled(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateIsSpellCheckEnabled(editor);
public static void MapFont(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateFont(editor, handler.GetRequiredService<IFontManager>());

Просмотреть файл

@ -22,6 +22,7 @@ namespace Microsoft.Maui.Handlers
[nameof(IEditor.Font)] = MapFont,
[nameof(IEditor.IsReadOnly)] = MapIsReadOnly,
[nameof(IEditor.IsTextPredictionEnabled)] = MapIsTextPredictionEnabled,
[nameof(IEditor.IsSpellCheckEnabled)] = MapIsSpellCheckEnabled,
[nameof(IEditor.MaxLength)] = MapMaxLength,
[nameof(IEditor.Placeholder)] = MapPlaceholder,
[nameof(IEditor.PlaceholderColor)] = MapPlaceholderColor,

Просмотреть файл

@ -120,6 +120,9 @@ namespace Microsoft.Maui.Handlers
public static void MapIsTextPredictionEnabled(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateIsTextPredictionEnabled(editor);
public static void MapIsSpellCheckEnabled(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateIsSpellCheckEnabled(editor);
public static void MapFont(IEditorHandler handler, IEditor editor) =>
handler.PlatformView?.UpdateFont(editor, handler.GetRequiredService<IFontManager>());

Просмотреть файл

@ -85,6 +85,9 @@ namespace Microsoft.Maui.Handlers
public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateIsTextPredictionEnabled(entry);
public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateIsSpellCheckEnabled(entry);
public static void MapMaxLength(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateMaxLength(entry);

Просмотреть файл

@ -11,7 +11,20 @@ namespace Microsoft.Maui.Handlers
public static void MapIsPassword(IEntryHandler handler, IEntry entry) { }
public static void MapHorizontalTextAlignment(IEntryHandler handler, IEntry entry) { }
public static void MapVerticalTextAlignment(IEntryHandler handler, IEntry entry) { }
/// <summary>
/// Maps the abstract <see cref="ITextInput.IsTextPredictionEnabled"/> property to the platform-specific implementations.
/// </summary>
/// <param name="handler"> The associated handler.</param>
/// <param name="entry"> The associated <see cref="IEntry"/> instance.</param>
public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) { }
/// <summary>
/// Maps the abstract <see cref="ITextInput.IsSpellCheckEnabled"/> property to the platform-specific implementations.
/// </summary>
/// <param name="handler"> The associated handler.</param>
/// <param name="entry"> The associated <see cref="IEntry"/> instance.</param>
public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) { }
public static void MapMaxLength(IEntryHandler handler, IEntry entry) { }
public static void MapPlaceholder(IEntryHandler handler, IEntry entry) { }
public static void MapPlaceholderColor(IEntryHandler handler, IEntry entry) { }

Просмотреть файл

@ -91,6 +91,9 @@ namespace Microsoft.Maui.Handlers
public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateIsTextPredictionEnabled(entry);
[MissingMapper]
public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) { }
public static void MapMaxLength(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateMaxLength(entry);

Просмотреть файл

@ -70,6 +70,9 @@ namespace Microsoft.Maui.Handlers
public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateIsTextPredictionEnabled(entry);
public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateIsSpellCheckEnabled(entry);
public static void MapMaxLength(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateMaxLength(entry);

Просмотреть файл

@ -28,6 +28,7 @@ namespace Microsoft.Maui.Handlers
[nameof(IEntry.VerticalTextAlignment)] = MapVerticalTextAlignment,
[nameof(IEntry.IsReadOnly)] = MapIsReadOnly,
[nameof(IEntry.IsTextPredictionEnabled)] = MapIsTextPredictionEnabled,
[nameof(IEntry.IsSpellCheckEnabled)] = MapIsSpellCheckEnabled,
[nameof(IEntry.Keyboard)] = MapKeyboard,
[nameof(IEntry.MaxLength)] = MapMaxLength,
[nameof(IEntry.Placeholder)] = MapPlaceholder,

Просмотреть файл

@ -76,6 +76,9 @@ namespace Microsoft.Maui.Handlers
public static void MapIsTextPredictionEnabled(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateIsTextPredictionEnabled(entry);
public static void MapIsSpellCheckEnabled(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateIsSpellCheckEnabled(entry);
public static void MapMaxLength(IEntryHandler handler, IEntry entry) =>
handler.PlatformView?.UpdateMaxLength(entry);

Просмотреть файл

@ -6,12 +6,13 @@ using Android.Graphics.Drawables;
using Android.Text;
using Android.Text.Style;
using AResource = Android.Resource;
using AppCompatAlertDialog = AndroidX.AppCompat.App.AlertDialog;
namespace Microsoft.Maui.Handlers
{
public partial class PickerHandler : ViewHandler<IPicker, MauiPicker>
{
AlertDialog? _dialog;
AppCompatAlertDialog? _dialog;
protected override MauiPicker CreatePlatformView() =>
new MauiPicker(Context);
@ -108,7 +109,7 @@ namespace Microsoft.Maui.Handlers
{
if (_dialog == null && VirtualView != null)
{
using (var builder = new AlertDialog.Builder(Context))
using (var builder = new AppCompatAlertDialog.Builder(Context))
{
if (VirtualView.TitleColor == null)
{

Просмотреть файл

@ -14,20 +14,16 @@ namespace Microsoft.Maui.Handlers
protected override RefreshContainer CreatePlatformView()
{
var refreshContainer = new RefreshContainer
return new RefreshContainer
{
ManipulationMode = UI.Xaml.Input.ManipulationModes.All,
PullDirection = RefreshPullDirection.TopToBottom
};
return refreshContainer;
}
protected override void ConnectHandler(RefreshContainer nativeView)
{
nativeView.Loaded += OnLoaded;
nativeView.RefreshRequested += OnRefresh;
nativeView.ManipulationDelta += OnManipulationDelta;
base.ConnectHandler(nativeView);
}
@ -36,7 +32,6 @@ namespace Microsoft.Maui.Handlers
{
nativeView.Loaded -= OnLoaded;
nativeView.RefreshRequested -= OnRefresh;
nativeView.ManipulationDelta += OnManipulationDelta;
CompleteRefresh();
@ -119,18 +114,6 @@ namespace Microsoft.Maui.Handlers
VirtualView.IsRefreshing = true;
}
void OnManipulationDelta(object sender, UI.Xaml.Input.ManipulationDeltaRoutedEventArgs e)
{
if (e.PointerDeviceType is UI.Input.PointerDeviceType.Touch)
return; // Already managed by the RefreshContainer control itself
const double minimumCumulativeY = 20;
double cumulativeY = e.Cumulative.Translation.Y;
if (cumulativeY > minimumCumulativeY && VirtualView is not null && !VirtualView.IsRefreshing)
VirtualView.IsRefreshing = true;
}
void CompleteRefresh()
{
if (_refreshCompletionDeferral != null)

Просмотреть файл

@ -99,6 +99,11 @@ namespace Microsoft.Maui.Handlers
handler.PlatformView?.UpdateIsTextPredictionEnabled(searchBar, handler.QueryEditor);
}
public static void MapIsSpellCheckEnabled(ISearchBarHandler handler, ISearchBar searchBar)
{
handler.PlatformView?.UpdateIsSpellCheckEnabled(searchBar, handler.QueryEditor);
}
public static void MapMaxLength(ISearchBarHandler handler, ISearchBar searchBar)
{
handler.PlatformView?.UpdateMaxLength(searchBar, handler.QueryEditor);

Просмотреть файл

@ -19,7 +19,20 @@ namespace Microsoft.Maui.Handlers
public static void MapCharacterSpacing(IViewHandler handler, ISearchBar searchBar) { }
public static void MapTextColor(IViewHandler handler, ISearchBar searchBar) { }
public static void MapCancelButtonColor(IViewHandler handler, ISearchBar searchBar) { }
/// <summary>
/// Maps the abstract <see cref="ITextInput.IsTextPredictionEnabled"/> property to the platform-specific implementations.
/// </summary>
/// <param name="handler"> The associated handler.</param>
/// <param name="searchBar"> The associated <see cref="ISearchBar"/> instance.</param>
public static void MapIsTextPredictionEnabled(IViewHandler handler, ISearchBar searchBar) { }
/// <summary>
/// Maps the abstract <see cref="ITextInput.IsSpellCheckEnabled"/> property to the platform-specific implementations.
/// </summary>
/// <param name="handler"> The associated handler.</param>
/// <param name="searchBar"> The associated <see cref="ISearchBar"/> instance.</param>
public static void MapIsSpellCheckEnabled(IViewHandler handler, ISearchBar searchBar) { }
public static void MapMaxLength(IViewHandler handler, ISearchBar searchBar) { }
public static void MapIsReadOnly(IViewHandler handler, ISearchBar searchBar) { }
public static void MapKeyboard(IViewHandler handler, ISearchBar searchBar) { }

Просмотреть файл

@ -75,6 +75,9 @@ namespace Microsoft.Maui.Handlers
handler.PlatformView?.Entry.UpdateIsTextPredictionEnabled(searchBar);
}
[MissingMapper]
public static void MapIsSpellCheckEnabled(ISearchBarHandler handler, ISearchBar searchBar) { }
public static void MapKeyboard(ISearchBarHandler handler, ISearchBar searchBar)
{
handler.PlatformView?.Entry.UpdateKeyboard(searchBar);

Просмотреть файл

@ -84,6 +84,11 @@ namespace Microsoft.Maui.Handlers
handler.PlatformView?.UpdateIsTextPredictionEnabled(searchBar);
}
public static void MapIsSpellCheckEnabled(ISearchBarHandler handler, ISearchBar searchBar)
{
handler.PlatformView?.UpdateIsSpellCheckEnabled(searchBar);
}
public static void MapMaxLength(ISearchBarHandler handler, ISearchBar searchBar)
{
handler.PlatformView?.UpdateMaxLength(searchBar);
@ -114,6 +119,7 @@ namespace Microsoft.Maui.Handlers
PlatformView?.UpdateMaxLength(VirtualView);
PlatformView?.UpdateIsReadOnly(VirtualView);
PlatformView?.UpdateIsTextPredictionEnabled(VirtualView);
PlatformView?.UpdateIsSpellCheckEnabled(VirtualView);
PlatformView?.UpdateCancelButtonColor(VirtualView);
PlatformView?.UpdateKeyboard(VirtualView);
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше