Merge branch 'main' into net9.0

# Conflicts:
#	.config/dotnet-tools.json
#	eng/Version.Details.xml
#	eng/Versions.props
#	src/Controls/tests/TestCases.HostApp/CoreViews/CorePageView.cs
#	src/Controls/tests/TestCases.HostApp/Issues/Issue20439.xaml.cs
#	src/Controls/tests/TestCases.HostApp/Issues/Issue3089.cs
#	src/Controls/tests/TestCases.HostApp/Issues/Issue3333.cs
#	src/Controls/tests/TestCases.HostApp/MauiProgram.cs
#	src/Core/src/maui.aar
This commit is contained in:
Rui Marinho 2024-10-17 12:19:23 +01:00
Родитель a85cb01f1d 51e8735286
Коммит 8d47b8c258
1199 изменённых файлов: 22855 добавлений и 5081 удалений

5
.github/ISSUE_TEMPLATE/bug-report.yml поставляемый
Просмотреть файл

@ -42,6 +42,7 @@ body:
label: Version with bug
description: In what version do you see this issue? Run `dotnet workload list` to find your version.
options:
- 9.0.0-rc.2.24503.2
- 9.0.0-rc.1.24453.9
- 9.0.0-preview.7.24407.4
- 9.0.0-preview.6.24327.7
@ -50,6 +51,7 @@ body:
- 9.0.0-preview.3.10457
- 9.0.0-preview.2.10293
- 9.0.0-preview.1.9973
- 8.0.92 SR9.2
- 8.0.91 SR9.1
- 8.0.90 SR9
- 8.0.82 SR8.2
@ -128,6 +130,7 @@ body:
- 8.0.82 SR8.2
- 8.0.90 SR9
- 8.0.91 SR9.1
- 8.0.92 SR9.2
- 9.0.0-preview.1.9973
- 9.0.0-preview.2.10293
- 9.0.0-preview.3.10457
@ -135,6 +138,8 @@ body:
- 9.0.0-preview.5.24307.10
- 9.0.0-preview.6.24327.7
- 9.0.0-preview.7.24407.4
- 9.0.0-rc.1.24453.9
- 9.0.0-rc.2.24503.2
validations:
required: true
- type: dropdown

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

@ -32,7 +32,7 @@ The `Orientation` property of `IScrollView` can be one of four values (in the `S
- `Both` - the content scrolls horizontally if it's wider than the viewport, and vertically if it's taller than the viewport
- `Neither` - scrolling is disabled in both directions
The `Orientation` value affects how the ScrollView's `Content` is measured and laid out. If the value is `Vertical`, the measurement height is unconstrained (i.e., `Double.Infinity`). If the value is `Horizontal`, the measurement width is unconstrained. `Both` results in measurement being unconstrained in all directions, and `Neither` constrains the measurement to the width and height of the viewport.
The `Orientation` value affects how the ScrollView's `Content` is measured and arranged. If the value is `Vertical`, the measurement height is unconstrained (i.e., `Double.Infinity`). If the value is `Horizontal`, the measurement width is unconstrained. `Both` results in measurement being unconstrained in all directions, and `Neither` constrains the measurement to the width and height of the viewport.
## ContentSize
@ -72,7 +72,7 @@ Our Android implementation of ScrollView is backed by MauiScrollView, which is a
- Android treats `Padding` as space around the scrollable area, rather than inside of it.
- Android's native measurements will not account for our virtual `Margin` when measuring ScrollView content.
So again, we insert an intermediate `ContentViewGroup` to handle these problems. The `ContentViewGroup` is laid out at (0, 0) in the MauiScrollView; it handles the `Padding` and `Margin` behaviors for us, and initiates `CrossPlatformMeasure()` and `CrossPlatformArrange()` for its `Content`.
So again, we insert an intermediate `ContentViewGroup` to handle these problems. The `ContentViewGroup` is arranged at (0, 0) in the MauiScrollView; it handles the `Padding` and `Margin` behaviors for us, and initiates `CrossPlatformMeasure()` and `CrossPlatformArrange()` for its `Content`.
Another note: the content of an Android ScrollView does not stretch to fill the viewport by default. That is, if you have a ScrollView which fills the screen and the content of the ScrollView is smaller than the screen, by default that content will not expand to take up the entire viewport (the behavior we expect for .NET MAUI). On Android, we can achieve the behavior we expect by setting the `FillViewport` property to `true` for the native ScrollView. This is all handled automatically by the Android ScrollViewHandler; I note it here because this causes an extra measure pass when the content is smaller than the ScrollView's viewport and the virtual ScrollView has layout alignment set to `Fill`. This is all explained in the comments for the ScrollViewHandler's `GetDesiredSize()` override, but I'm calling it out here as well in case anyone is investigating the number of measure calls being made.

Двоичные данные
eng/debug.keystore

Двоичный файл не отображается.

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

@ -165,6 +165,7 @@ steps:
${{ parameters.checkoutDirectory }}/artifacts/**/vs-workload.props
${{ parameters.checkoutDirectory }}/eng/automation/SignList.xml
${{ parameters.checkoutDirectory }}/eng/automation/SignVerifyIgnore.txt
${{ parameters.checkoutDirectory }}/eng/automation/guardian/**
!${{ parameters.checkoutDirectory}}/artifacts/docs-packs/**
!${{ parameters.checkoutDirectory}}/artifacts/binaries/**
!${{ parameters.checkoutDirectory}}/artifacts/**/res.zip

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

@ -21,6 +21,7 @@ stages:
condition: eq(variables.signingCondition, true)
use1ESTemplate: true
usePipelineArtifactTasks: true
checkoutType : 'self'
- template: nuget-msi-convert/job/v4.yml@yaml-templates
parameters:
@ -37,6 +38,14 @@ stages:
patterns: |
**/SignVerifyIgnore.txt
- task: DownloadPipelineArtifact@2
inputs:
artifactName: nuget
downloadPath: $(Build.SourcesDirectory)\eng\automation\guardian
patterns: |
**/tsaoptions-v2.json
**/source.gdnsuppress
- task: MicroBuildCodesignVerify@3
displayName: verify signed msi content
inputs:

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

@ -99,6 +99,9 @@ extends:
- repository: yaml-templates
suppression:
suppressionFile: $(Build.SourcesDirectory)\eng\automation\guardian\source.gdnsuppress
tsa:
enabled: true
configFile: '$(Build.SourcesDirectory)\eng\automation\guardian\tsaoptions-v2.json'
stages:
- stage: pack_net
displayName: Pack .NET MAUI
@ -195,6 +198,8 @@ extends:
poolName: ${{ parameters.VM_IMAGE_HOST.name }}
vmImage: ${{ parameters.VM_IMAGE_HOST.image }}
os: ${{ parameters.VM_IMAGE_HOST.os }}
tsaUploadEnabled: true
tsaConfigFile: '$(Build.SourcesDirectory)\eng\automation\guardian\tsaoptions-v2.json'
scanArtifacts: ['${{ parameters.PackPlatform.binariesArtifact }}']
softwareVersion: 9.0

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

@ -58,29 +58,28 @@ if (Test-Path $versionPropsPath)
{
Write-Output "Reading versions from Version.props..."
[xml]$versionProps = Get-Content $versionPropsPath
$versionPropsAppiumVersion = $versionProps.Project.PropertyGroup.AppiumVersion | Where-Object { $_ -ne $null } | Select-Object -Last 1
if ($versionPropsAppiumVersion -ne $null) {
if ($null -ne $versionPropsAppiumVersion) {
$appiumVersion = $versionPropsAppiumVersion
}
$versionPropsWindowsDriverVersion = $versionProps.Project.PropertyGroup.AppiumWindowsDriverVersion | Where-Object { $_ -ne $null } | Select-Object -Last 1
if ($versionPropsWindowsDriverVersion -ne $null) {
if ($null -ne $versionPropsWindowsDriverVersion) {
$windowsDriverVersion = $versionPropsWindowsDriverVersion
}
$versionPropsUIAutomator2DriverVersion = $versionProps.Project.PropertyGroup.AppiumUIAutomator2DriverVersion | Where-Object { $_ -ne $null } | Select-Object -Last 1
if ($versionPropsUIAutomator2DriverVersion -ne $null) {
if ($null -ne $versionPropsUIAutomator2DriverVersion) {
$androidDriverVersion = $versionPropsUIAutomator2DriverVersion
}
$versionPropsXCUItestDriverVersion = $versionProps.Project.PropertyGroup.AppiumXCUITestDriverVersion | Where-Object { $_ -ne $null } | Select-Object -Last 1
if ($versionPropsXCUItestDriverVersion -ne $null) {
if ($null -ne $versionPropsXCUItestDriverVersion) {
$iOSDriverVersion = $versionPropsXCUItestDriverVersion
}
$versionPropsMac2DriverVersion = $versionProps.Project.PropertyGroup.AppiumMac2DriverVersion | Where-Object { $_ -ne $null } | Select-Object -Last 1
if ($versionPropsMac2DriverVersion -ne $null) {
if ($null -ne $versionPropsMac2DriverVersion) {
$macDriverVersion = $versionPropsMac2DriverVersion
}
}
@ -119,7 +118,7 @@ if ($AppiumHome) {
# Check for an existing appium install version
$appiumCurrentVersion = ""
try { $appiumCurrentVersion = appium -v | Out-String } catch { }
try { $appiumCurrentVersion = appium -v | Out-String } catch { Write-Debug "Problem" }
if ($appiumCurrentVersion) {
Write-Output "Existing Appium version $appiumCurrentVersion"
@ -140,7 +139,7 @@ if ($missingAppium -or ($appiumCurrentVersion -ne $appiumVersion)) {
Write-Output "Installing appium $appiumVersion"
npm install --logs-dir=$logsDir --loglevel $npmLogLevel -g appium@$appiumVersion
write-Output "Installed appium $appiumVersion"
write-Output "Installed appium $appiumVersion"
}
$existingDrivers = appium driver list --installed --json | ConvertFrom-Json
@ -169,7 +168,6 @@ if ($IsMacOS) {
appium driver install xcuitest@$iOSDriverVersion
Write-Output "Installed appium driver xcuitest"
}
if ($existingDrivers.mac2) {
Write-Output "Updating appium driver mac2"
appium driver update mac2
@ -201,7 +199,7 @@ if ($IsWindows) {
}
if ($IsMacOS) {
appium driver doctor xcuitest || & { "ignore failure"; $global:LASTEXITCODE = 0 }
appium driver doctor mac2 || & { "ignore failure"; $global:LASTEXITCODE = 0 }
appium driver doctor mac2 || & { "ignore failure"; $global:LASTEXITCODE = 0 }
}
appium driver doctor uiautomator2 || & { "ignore failure"; $global:LASTEXITCODE = 0 }

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

@ -1,4 +1,4 @@
<#
<#
.SYNOPSIS
Updates the Versions.props variables.
@ -93,4 +93,4 @@ Write-Output("tvOS version: " + $xmlDoc.Project.PropertyGroup.MicrosofttvOSSdkPa
Write-Output("MacCatalyst version: " + $xmlDoc.Project.PropertyGroup.MicrosoftMacCatalystSdkPackageVersion)
Write-Output("Mac version: " + $xmlDoc.Project.PropertyGroup.MicrosoftmacOSSdkPackageVersion)
$xmlDoc.Save($xmlFileName)
$xmlDoc.Save($xmlFileName)

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

@ -23,11 +23,6 @@
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>$(DefineConstants);ENABLE_TEST_CLOUD</DefineConstants>
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>$(MSBuildThisFileDirectory)../../../../../eng/debug.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>android</AndroidSigningStorePass>
<AndroidSigningKeyAlias>androiddebugkey</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>android</AndroidSigningKeyPass>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

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

@ -30,7 +30,7 @@ namespace Microsoft.Maui.Controls.ControlGallery.Issues
Content = new StackLayout
{
Children = {
new Label { Text = "The following list contains cells with and without context actions, but all of the cells should be laid out identically. If the cells do not look identical, this test has failed." },
new Label { Text = "The following list contains cells with and without context actions, but all of the cells should be arranged identically. If the cells do not look identical, this test has failed." },
list }
};
}

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

@ -56,16 +56,16 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Android
renderer?.UpdateLayout();
// If we're using a PageContainer (i.e., we've wrapped our contents in a Fragment),
// Make sure that it gets laid out
// Make sure that it gets arranged
if (_pageContainer != null)
{
if (_isFlyout)
{
var controller = (IFlyoutPageController)_parent;
var width = (int)Context.ToPixels(controller.FlyoutBounds.Width);
// When the base class computes the size of the Flyout container, it starts at the top of the
// When the base carrangedss computes the size of the Flyout container, it starts at the top of the
// screen and adds padding (_parent.FlyoutBounds.Top) to leave room for the status bar
// When this container is laid out, it's already starting from the adjusted y value of the parent,
// When this container is arranged, it's already starting from the adjusted y value of the parent,
// so we subtract _parent.FlyoutBounds.Top from our starting point (to get 0) and add it to the
// bottom (so the flyout page stretches to the bottom of the screen)
var height = (int)Context.ToPixels(controller.FlyoutBounds.Height + controller.FlyoutBounds.Top);

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

@ -442,7 +442,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat
toolbarLayoutCompleted = true;
}
// Making the layout of the toolbar dependant on having a child Page could potentially mean that the toolbar is not laid out.
// Making the layout of the toolbar dependant on having a child Page could potentially mean that the toolbar is not arranged.
// We'll do one more check to make sure it isn't missed.
if (!toolbarLayoutCompleted)
{

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

@ -74,7 +74,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.Android
protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
// we need to make sure we are big enough to be laid out at 0,0
// we need to make sure we are big enough to be arranged at 0,0
if (_childView != null)
{
SetMeasuredDimension((int)Context.ToPixels(_childView.Bounds.Right + _parent.Padding.Right), (int)Context.ToPixels(_childView.Bounds.Bottom + _parent.Padding.Bottom));

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

@ -163,7 +163,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
ClearRtlScrollCheck();
// Adding items into the view while scrolling to the end can cause it to fail, as
// the items have not actually been laid out and return incorrect scroll position
// the items have not actually been arranged and return incorrect scroll position
// values. The ScrollViewRenderer for Android does something similar by waiting up
// to 10ms for layout to occur.
int cycle = 0;

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

@ -228,7 +228,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP
if (ArrangeNativeChildren)
{
// in the event that a custom renderer has added native controls,
// we need to be sure to arrange them so that they are laid out.
// we need to be sure to arrange them so that they are arranged.
var nativeChildren = Children;
for (int i = 0; i < nativeChildren.Count; i++)
{

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

@ -256,7 +256,7 @@ namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS
// Cache the size for next time
_size = toSize;
// Let the controller know that things need to be laid out again
// Let the controller know that things need to be arranged again
OnContentSizeChanged();
}

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

@ -354,7 +354,7 @@ namespace Microsoft.Maui.Controls.Foldable
{
if (_twoPaneViewLayoutGuide.Mode == TwoPaneViewMode.Wide)
{
// Regions are laid out horizontally
// Regions are arranged horizontally
if (WideModeConfiguration != TwoPaneViewWideModeConfiguration.SinglePane)
{
newMode = (WideModeConfiguration == TwoPaneViewWideModeConfiguration.LeftRight) ? ViewMode.LeftRight : ViewMode.RightLeft;
@ -362,7 +362,7 @@ namespace Microsoft.Maui.Controls.Foldable
}
else if (_twoPaneViewLayoutGuide.Mode == TwoPaneViewMode.Tall)
{
// Regions are laid out vertically
// Regions are arranged vertically
if (TallModeConfiguration != TwoPaneViewTallModeConfiguration.SinglePane)
{
newMode = (TallModeConfiguration == TwoPaneViewTallModeConfiguration.TopBottom) ? ViewMode.TopBottom : ViewMode.BottomTop;

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

@ -14,31 +14,6 @@
<Interfaces />
<Docs>
<summary>Selects <see cref="T:Microsoft.Maui.Controls.DataTemplate" /> objects by data type and container.</summary>
<remarks>
<para>Application developers override the <see cref="M:Microsoft.Maui.Controls.DataTemplateSelector.OnSelectTemplate(System.Object,Microsoft.Maui.Controls.BindableObject)" /> method to return a unique <see cref="T:Microsoft.Maui.Controls.DataTemplate" /> for a data type and parent container combination. Additionally, because the same exact template instance must be returned for a given piece of data across successive calls to <see cref="M:Microsoft.Maui.Controls.DataTemplateSelector.SelectTemplate(System.Object,Microsoft.Maui.Controls.BindableObject)" />, developers should create and store these <see cref="T:Microsoft.Maui.Controls.DataTemplate" /> in their constructor overrides.</para>
Developers should note the following items: <list type="bullet"><item><term>OnSelectTemplate must not return another DataTemplateSelector, and
</term></item><item><term>The Android platform is limited to 20 templates per list view.</term></item></list>
<example>The following example shows a basic use:
<code lang="c#"><![CDATA[class MyDataTemplateSelector : DataTemplateSelector
{
public MyDataTemplateSelector ()
{
// Retain instances
this.templateOne = new DataTemplate (typeof (ViewA));
this.templateTwo = new DataTemplate (typeof (ViewB));
}
protected override DataTemplate OnSelectTemplate (object item, BindableObject container)
{
if (item is double)
return this.templateOne;
return this.templateTwo;
}
private readonly DataTemplate templateOne;
private readonly DataTemplate templateTwo;
}]]></code></example>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">

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

@ -19,7 +19,7 @@
<summary>A Flexbox-like layout that lays out child elements in optionally wrappable rows or columns of child elements.</summary>
<remarks>
<para>FlexLayout is a <see cref="T:Microsoft.Maui.Controls.Layout" /> that efficiently lays out it's <see cref="P:Microsoft.Maui.Controls.Layout.Children" /> in a manner similar to that of <format type="text/html"><a href="https://www.w3.org/TR/css-flexbox-1/">CSS Flexbox</a></format>.</para>
<para>The <see cref="P:Microsoft.Maui.Controls.FlexLayout.Direction" /> property determines the primary axis of the layout. The <see cref="P:Microsoft.Maui.Controls.FlexLayout.JustifyContent" /> property determines how <see cref="P:Microsoft.Maui.Controls.Layout.Children" /> are laid out along the primary axis. The <see cref="P:Microsoft.Maui.Controls.FlexLayout.AlignItems" /> property specifies how <see cref="P:Microsoft.Maui.Controls.Layout.Children" /> are laid out along the cross axis; the <see cref="P:Microsoft.Maui.Controls.FlexLayout.AlignContent" /> property works similarly, but applies to entire rows or columns, not individual elements.</para>
<para>The <see cref="P:Microsoft.Maui.Controls.FlexLayout.Direction" /> property determines the primary axis of the layout. The <see cref="P:Microsoft.Maui.Controls.FlexLayout.JustifyContent" /> property determines how <see cref="P:Microsoft.Maui.Controls.Layout.Children" /> are arranged along the primary axis. The <see cref="P:Microsoft.Maui.Controls.FlexLayout.AlignItems" /> property specifies how <see cref="P:Microsoft.Maui.Controls.Layout.Children" /> are arranged along the cross axis; the <see cref="P:Microsoft.Maui.Controls.FlexLayout.AlignContent" /> property works similarly, but applies to entire rows or columns, not individual elements.</para>
<para>The initial size of a child element is set with <see cref="M:Microsoft.Maui.Controls.FlexLayout.SetBasis(Microsoft.Maui.Controls.BindableObject,Microsoft.Maui.Layouts.FlexBasis)" /> and its resizing behavior is set with <see cref="M:Microsoft.Maui.Controls.FlexLayout.SetGrow(Microsoft.Maui.Controls.BindableObject,System.Single)" /> and <see cref="M:Microsoft.Maui.Controls.FlexLayout.SetShrink(Microsoft.Maui.Controls.BindableObject,System.Single)" />.</para>
</remarks>
<related type="article" href="https://learn.microsoft.com/dotnet/maui/user-interface/layouts/flexlayout">The .NET MAUI FlexLayout</related>
@ -100,8 +100,8 @@
<ReturnType>Microsoft.Maui.Layouts.FlexAlignItems</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that controls how child elements are laid out within their row or column.</summary>
<value>A value that controls how child elements are laid out within their row or column.</value>
<summary>Gets or sets a value that controls how child elements are arranged within their row or column.</summary>
<value>A value that controls how child elements are arranged within their row or column.</value>
<remarks>
<para>The following image shows the options for <see cref="P:Microsoft.Maui.Controls.FlexLayout.AlignItems" /> with <see cref="P:Microsoft.Maui.Controls.FlexLayout.Direction" /> set to <see cref="F:Microsoft.Maui.Layouts.FlexDirection.Column" /> and <see cref="P:Microsoft.Maui.Controls.FlexLayout.JustifyContent" /> set to <see cref="F:Microsoft.Maui.Layouts.FlexJustify.Start" />:</para>
<para>

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

@ -14,12 +14,10 @@ namespace Microsoft.Maui.Controls
{
public partial class Button : ICrossPlatformLayout
{
// _originalImageSize and _originalImageSource are used to ensure we don't resize the image
// larger than the original image size and to ensure if a new image is loaded, we use that image's size for resizing.
CGSize _originalImageSize = CGSize.Empty;
// _isFirstMeasure is a flag to make sure we manually recalculate the titleRect when there are dynamic changes to the button.
// There are times the platformButton.TitleLabel is updated on dynamic changes and reacts to the change by truncating the label when we actually
// have space in our constraints. We provide the space to be used in our first measure of the titleRect and then use the newly laid out titleRect in later iterations.
bool _isFirstMeasure = true;
string _originalImageSource = string.Empty;
/// <summary>
/// Measure the desired size of the button based on the image and title size taking into account
@ -86,8 +84,9 @@ namespace Microsoft.Maui.Controls
if (image is not null)
{
// Save the original image size for later image resizing
if (_originalImageSize == CGSize.Empty)
if (_originalImageSize == CGSize.Empty || _originalImageSource == string.Empty || _originalImageSource != button.ImageSource.ToString())
{
_originalImageSource = button.ImageSource.ToString();
_originalImageSize = image.Size;
}
@ -144,11 +143,8 @@ namespace Microsoft.Maui.Controls
}
}
// if we are in a scenario with unlimited width and the image is on top or bottom,
// of if the horizontalOption is not fill and the image is on top or bottom,
// let's make sure the title is not cut off by ensuring we have enough padding for the image and title.
// if the image is on top or bottom, let's make sure the title is not cut off by ensuring we have enough padding for the image and title.
if (image is not null
&& (widthConstraint == double.PositiveInfinity || button.HorizontalOptions != LayoutOptions.Fill)
&& (layout.Position == ButtonContentLayout.ImagePosition.Top || layout.Position == ButtonContentLayout.ImagePosition.Bottom))
{
var maxTitleRect = ComputeTitleRect(platformButton, button, image, double.PositiveInfinity, double.PositiveInfinity, borderWidth, padding, true);
@ -163,8 +159,6 @@ namespace Microsoft.Maui.Controls
var returnSize = new Size(Math.Min(buttonContentWidth, widthConstraint),
Math.Min(buttonContentHeight, heightConstraint));
_isFirstMeasure = false;
// Rounding the values up to the nearest whole number to match UIView.SizeThatFits
return new Size((int)Math.Ceiling(returnSize.Width), (int)Math.Ceiling(returnSize.Height));
}
@ -183,8 +177,6 @@ namespace Microsoft.Maui.Controls
// Layout the image and title of the button
LayoutButton(platformButton, this, bounds);
_isFirstMeasure = true;
return new Size(bounds.Width, bounds.Height);
}
@ -292,39 +284,40 @@ namespace Microsoft.Maui.Controls
return CGRect.Empty;
}
// Use the current TitleLabel if it is set and valid
var titleRect = platformButton.TitleLabel.Bounds;
var titleWidthConstraint = widthConstraint - ((nfloat)borderWidth * 2);
var titleHeightConstraint = heightConstraint - ((nfloat)borderWidth * 2);
if ((isMeasuring && _isFirstMeasure) || titleRect.Height == 0 || titleRect.Width == 0)
if (image is not null && !string.IsNullOrEmpty(platformButton.CurrentTitle) && titleWidthConstraint != double.PositiveInfinity)
{
var titleWidthConstraint = widthConstraint - ((nfloat)borderWidth * 2);
var titleHeightConstraint = heightConstraint - ((nfloat)borderWidth * 2);
if (image is not null && !string.IsNullOrEmpty(platformButton.CurrentTitle) && titleWidthConstraint != double.PositiveInfinity)
{
// In non-UIButtonConfiguration setups, the title will always be truncated by the image's width
// even when the image is on top or bottom.
titleWidthConstraint -= image.Size.Width;
}
if (image is not null && button.ContentLayout.Position == ButtonContentLayout.ImagePosition.Left || button.ContentLayout.Position == ButtonContentLayout.ImagePosition.Right)
{
titleWidthConstraint -= (nfloat)(button.ContentLayout.Spacing + padding.Left + padding.Right);
}
else if (image is null)
{
titleWidthConstraint -= (nfloat)(padding.Left + padding.Right);
}
titleRect = platformButton.GetTitleBoundingRect(titleWidthConstraint, titleHeightConstraint);
// In non-UIButtonConfiguration setups, the title will always be truncated by the image's width
// even when the image is on top or bottom.
titleWidthConstraint -= image.Size.Width;
}
// Measure the width of the sample character string using the same font as the TitleLabel. If a character cannot fit in the titleRect, let's use a zero size.
var minimumCharacterWidth = new Foundation.NSString("A").GetSizeUsingAttributes(new UIStringAttributes { Font = platformButton.TitleLabel.Font });
if (double.IsNaN(titleRect.Width) || double.IsNaN(titleRect.Height) || titleRect.Width < minimumCharacterWidth.Width)
if (image is not null && button.ContentLayout.Position == ButtonContentLayout.ImagePosition.Left || button.ContentLayout.Position == ButtonContentLayout.ImagePosition.Right)
{
titleRect = Rect.Zero;
titleWidthConstraint -= (nfloat)(button.ContentLayout.Spacing + padding.Left + padding.Right);
}
else if (image is null)
{
titleWidthConstraint -= (nfloat)(padding.Left + padding.Right);
}
var titleRect = platformButton.GetTitleBoundingRect(titleWidthConstraint, titleHeightConstraint);
var currentTitleText = platformButton.CurrentTitle;
// We will only do this for buttons with image on left and right because the left and right padding are handled differently
// when the image is on the top or bottom
if (currentTitleText.Length > 0 && button.ContentLayout.Position == ButtonContentLayout.ImagePosition.Left || button.ContentLayout.Position == ButtonContentLayout.ImagePosition.Right)
{
// Measure the width of the first character in the string using the same font as the TitleLabel. If a character cannot fit in the titleRect, let's use a zero size.
var minimumCharacterWidth = new Foundation.NSString(currentTitleText.Substring(0,1)).GetSizeUsingAttributes(new UIStringAttributes { Font = platformButton.TitleLabel.Font });
if (double.IsNaN(titleRect.Width) || double.IsNaN(titleRect.Height) || titleRect.Width < minimumCharacterWidth.Width)
{
titleRect = Rect.Zero;
}
}
return titleRect;

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

@ -29,9 +29,6 @@ namespace Microsoft.Maui.Controls.Handlers.Items
if (IsValidAdapter())
{
_adapter.NotifyItemInserted(startIndex);
var changedCount = _adapter.ItemCount - startIndex;
_adapter.NotifyItemRangeChanged(startIndex, changedCount);
}
}
@ -40,10 +37,6 @@ namespace Microsoft.Maui.Controls.Handlers.Items
if (IsValidAdapter())
{
_adapter.NotifyItemMoved(fromPosition, toPosition);
var minPosition = System.Math.Min(fromPosition, toPosition);
var changedCount = _adapter.ItemCount - minPosition;
_adapter.NotifyItemRangeChanged(minPosition, changedCount);
}
}
@ -58,9 +51,6 @@ namespace Microsoft.Maui.Controls.Handlers.Items
if (IsValidAdapter())
{
_adapter.NotifyItemRangeInserted(startIndex, count);
var changedCount = _adapter.ItemCount - startIndex;
_adapter.NotifyItemRangeChanged(startIndex, changedCount);
}
}
@ -69,9 +59,6 @@ namespace Microsoft.Maui.Controls.Handlers.Items
if (IsValidAdapter())
{
_adapter.NotifyItemRangeRemoved(startIndex, count);
var changedCount = _adapter.ItemCount - startIndex;
_adapter.NotifyItemRangeChanged(startIndex, changedCount);
}
}
@ -80,9 +67,6 @@ namespace Microsoft.Maui.Controls.Handlers.Items
if (IsValidAdapter())
{
_adapter.NotifyItemRemoved(startIndex);
var changedCount = _adapter.ItemCount - startIndex;
_adapter.NotifyItemRangeChanged(startIndex, changedCount);
}
}

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

@ -569,11 +569,12 @@ namespace Microsoft.Maui.Controls.Handlers.Items
itemCount++;
}
var showEmptyView = ItemsView?.EmptyView != null && ItemsViewAdapter.ItemCount == itemCount;
var showEmptyView = (ItemsView?.EmptyView is not null || ItemsView?.EmptyViewTemplate is not null) && ItemsViewAdapter.ItemCount == itemCount;
var currentAdapter = GetAdapter();
if (showEmptyView && currentAdapter != _emptyViewAdapter)
{
GetRecycledViewPool().Clear();
SwapAdapter(_emptyViewAdapter, true);
// TODO hartez 2018/10/24 17:34:36 If this works, cache this layout manager as _emptyLayoutManager
@ -582,6 +583,7 @@ namespace Microsoft.Maui.Controls.Handlers.Items
}
else if (!showEmptyView && currentAdapter != ItemsViewAdapter)
{
GetRecycledViewPool().Clear();
SwapAdapter(ItemsViewAdapter, true);
UpdateLayoutManager();
}

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

@ -126,6 +126,7 @@ namespace Microsoft.Maui.Controls.Handlers.Items
break;
}
UpdateItemContentControlSelection();
_ignorePlatformSelectionChange = false;
}
@ -160,13 +161,7 @@ namespace Microsoft.Maui.Controls.Handlers.Items
break;
}
var formsItemContentControls = ListViewBase.GetChildren<ItemContentControl>();
foreach (var formsItemContentControl in formsItemContentControls)
{
bool isSelected = ItemsView.SelectedItem == formsItemContentControl.FormsDataContext || ItemsView.SelectedItems.Contains(formsItemContentControl.FormsDataContext);
formsItemContentControl.UpdateIsSelected(isSelected);
}
UpdateItemContentControlSelection();
}
void UpdateVirtualSingleSelection()
@ -200,6 +195,17 @@ namespace Microsoft.Maui.Controls.Handlers.Items
ItemsView.SelectionChanged += VirtualSelectionChanged;
}
void UpdateItemContentControlSelection()
{
var formsItemContentControls = ListViewBase.GetChildren<ItemContentControl>();
foreach (var formsItemContentControl in formsItemContentControls)
{
bool isSelected = ItemsView.SelectedItem == formsItemContentControl.FormsDataContext || ItemsView.SelectedItems.Contains(formsItemContentControl.FormsDataContext);
formsItemContentControl.UpdateIsSelected(isSelected);
}
}
protected override void UpdateItemsSource()
{
_ignorePlatformSelectionChange = true;

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

@ -68,7 +68,7 @@ namespace Microsoft.Maui.Controls.Handlers.Items
if (_initialized)
{
// Reload the data so the currently visible cells get laid out according to the new layout
// Reload the data so the currently visible cells get arranged according to the new layout
CollectionView.ReloadData();
}
}
@ -567,7 +567,7 @@ namespace Microsoft.Maui.Controls.Handlers.Items
internal void UpdateView(object view, DataTemplate viewTemplate, ref UIView uiView, ref VisualElement formsElement)
{
// Is view set on the ItemsView?
if (view == null)
if (view is null && viewTemplate is null)
{
if (formsElement != null)
{

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

@ -292,7 +292,7 @@ namespace Microsoft.Maui.Controls.Handlers.Items
// Cache the size for next time
_size = toSize;
// Let the controller know that things need to be laid out again
// Let the controller know that things need to be arranged again
OnContentSizeChanged();
}

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

@ -33,7 +33,6 @@ namespace Microsoft.Maui.Controls
_toolbarTracker.CollectionChanged += OnToolbarItemsChanged;
RootPage = rootPage;
_toolbarTracker.PageAppearing += OnPageAppearing;
_toolbarTracker.PagePropertyChanged += OnPagePropertyChanged;
_toolbarTracker.Target = RootPage;
}
@ -71,6 +70,7 @@ namespace Microsoft.Maui.Controls
if (sender is not ContentPage cp)
return;
_toolbarTracker.PagePropertyChanged -= OnPagePropertyChanged;
_currentPage = cp;
_currentNavigationPage = _currentPage.FindParentOfType<NavigationPage>();
@ -112,6 +112,7 @@ namespace Microsoft.Maui.Controls
_hasAppeared = true;
ApplyChanges(_currentNavigationPage);
_toolbarTracker.PagePropertyChanged += OnPagePropertyChanged;
}
// This is to catch scenarios where the user

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

@ -34,7 +34,13 @@ namespace Microsoft.Maui.Controls.Platform
if (label.FormattedText != null)
platformControl.UpdateInlines(label);
else
{
if (platformControl.TextHighlighters.Count > 0)
{
platformControl.TextHighlighters.Clear();
}
platformControl.Text = TextTransformUtilites.GetTransformedText(label.Text, label.TextTransform);
}
break;
}
}

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

@ -55,7 +55,9 @@ namespace Microsoft.Maui.Controls.Platform
NSStringDrawingOptions.UsesLineFragmentOrigin | NSStringDrawingOptions.UsesFontLeading | NSStringDrawingOptions.UsesDeviceMetrics,
null);
return new CGRect(boundingRectWithDeviceMetrics.Location, new CGSize(Math.Max(boundingRect.Width, boundingRectWithDeviceMetrics.Width), Math.Min(availableHeight, boundingRect.Height)));
return new CGRect(boundingRectWithDeviceMetrics.Location,
new CGSize(Math.Ceiling(Math.Max(boundingRect.Width, boundingRectWithDeviceMetrics.Width)),
Math.Ceiling(Math.Min(availableHeight, boundingRect.Height))));
}
return CGRect.Empty;
@ -85,6 +87,12 @@ namespace Microsoft.Maui.Controls.Platform
var text = TextTransformUtilites.GetTransformedText(button.Text, button.TextTransform);
platformButton.SetTitle(text, UIControlState.Normal);
// The TitleLabel retains its previous text value even after a new value is assigned. As a result, the label does not display the updated text and reverts to the old value when the button is re-measured
if (string.IsNullOrEmpty(button.Text))
{
platformButton.TitleLabel.Text = string.Empty;
}
// Content layout depends on whether or not the text is empty; changing the text means
// we may need to update the content layout
platformButton.UpdateContentLayout(button);

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

@ -47,6 +47,7 @@ using Compatibility = Microsoft.Maui.Controls.Compatibility;
[assembly: InternalsVisibleTo("Microsoft.Maui.Controls.Foldable.UnitTests")]
[assembly: InternalsVisibleTo("WinUI.UITests")]
[assembly: InternalsVisibleTo("Microsoft.Maui.Controls.DeviceTests")]
[assembly: InternalsVisibleTo("Controls.TestCases.HostApp")]
[assembly: InternalsVisibleTo("CommunityToolkit.Maui")]
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.Core")]
@ -54,6 +55,7 @@ using Compatibility = Microsoft.Maui.Controls.Compatibility;
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.UnitTests")]
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.Markup")]
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.Markup.UnitTests")]
[assembly: InternalsVisibleTo("Controls.TestCases.HostApp")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

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

@ -449,7 +449,7 @@ namespace Microsoft.Maui.Controls.Shapes
{
var width = Width;
// If the shape has never been laid out, then Width won't actually have a value;
// If the shape has never been arranged, then Width won't actually have a value;
// use the fallback value instead.
return width == -1 ? _fallbackWidth : width;
}
@ -461,7 +461,7 @@ namespace Microsoft.Maui.Controls.Shapes
{
var height = Height;
// If the shape has never been laid out, then Height won't actually have a value;
// If the shape has never been arranged, then Height won't actually have a value;
// use the fallback value instead.
return height == -1 ? _fallbackHeight : height;
}

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

@ -219,10 +219,10 @@ namespace Microsoft.Maui.Controls
}
/// <summary>
/// Gets or sets the <see cref="LayoutOptions" /> that define how the element gets laid out in a layout cycle. This is a bindable property.
/// Gets or sets the <see cref="LayoutOptions" /> that define how the element gets arranged in a layout cycle. This is a bindable property.
/// </summary>
/// <remarks>
/// Assigning <see cref="HorizontalOptions"/> modifies how the element is laid out when there is excess space available along the X axis from the parent layout.
/// Assigning <see cref="HorizontalOptions"/> modifies how the element is arranged when there is excess space available along the X axis from the parent layout.
/// If multiple elements inside a layout are set to expand, the extra space is distributed proportionally.
/// </remarks>
public LayoutOptions HorizontalOptions
@ -241,10 +241,10 @@ namespace Microsoft.Maui.Controls
}
/// <summary>
/// Gets or sets the <see cref="LayoutOptions" /> that define how the element gets laid out in a layout cycle. This is a bindable property.
/// Gets or sets the <see cref="LayoutOptions" /> that define how the element gets arrange in a layout cycle. This is a bindable property.
/// </summary>
/// <remarks>
/// Assigning <see cref="VerticalOptions"/> modifies how the element is laid out when there is excess space available along the Y axis from the parent layout.
/// Assigning <see cref="VerticalOptions"/> modifies how the element is arrange when there is excess space available along the Y axis from the parent layout.
/// If multiple elements inside a layout are set to expand, the extra space is distributed proportionally.
/// </remarks>
public LayoutOptions VerticalOptions

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

@ -404,34 +404,34 @@ namespace Microsoft.Maui.Controls.Core.UnitTests
Assert.Equal("1234", testPage.SomeQueryParameter);
}
[Fact]
public async Task NavigatingAndNavigatedFiresForShellModal()
{
Shell shell = new TestShell();
shell.Items.Add(CreateShellItem(shellItemRoute: "NewRoute", shellSectionRoute: "Section", shellContentRoute: "Content"));
// [Fact]
// public async Task NavigatingAndNavigatedFiresForShellModal()
// {
// Shell shell = new TestShell();
// shell.Items.Add(CreateShellItem(shellItemRoute: "NewRoute", shellSectionRoute: "Section", shellContentRoute: "Content"));
ShellNavigatingEventArgs shellNavigatingEventArgs = null;
ShellNavigatedEventArgs shellNavigatedEventArgs = null;
// ShellNavigatingEventArgs shellNavigatingEventArgs = null;
// ShellNavigatedEventArgs shellNavigatedEventArgs = null;
shell.Navigating += (_, args) =>
{
shellNavigatingEventArgs = args;
};
// shell.Navigating += (_, args) =>
// {
// shellNavigatingEventArgs = args;
// };
shell.Navigated += (_, args) =>
{
shellNavigatedEventArgs = args;
};
// shell.Navigated += (_, args) =>
// {
// shellNavigatedEventArgs = args;
// };
await shell.GoToAsync("ModalTestPage");
// await shell.GoToAsync("ModalTestPage");
Assert.NotNull(shellNavigatingEventArgs);
Assert.NotNull(shellNavigatedEventArgs);
// Assert.NotNull(shellNavigatingEventArgs);
// Assert.NotNull(shellNavigatedEventArgs);
Assert.Equal("//NewRoute/Section/Content", shellNavigatingEventArgs.Current.FullLocation.ToString());
Assert.Equal("//NewRoute/Section/Content/ModalTestPage", shellNavigatedEventArgs.Current.FullLocation.ToString());
// Assert.Equal("//NewRoute/Section/Content", shellNavigatingEventArgs.Current.FullLocation.ToString());
// Assert.Equal("//NewRoute/Section/Content/ModalTestPage", shellNavigatedEventArgs.Current.FullLocation.ToString());
}
// }
[Fact]
public async Task GetCurrentPageInModalNavigation()

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

@ -1,6 +1,4 @@
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace Microsoft.Maui.Controls.CustomAttributes
{

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

@ -80,9 +80,9 @@ namespace Microsoft.Maui.DeviceTests
{
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");
Assert.True(emptyView.Height > 0, "EmptyView should be arranged");
Assert.True(header.Height > 0, "Header should be arranged");
Assert.True(footer.Height > 0, "Footer should be arranged");
});
}

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 194 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 193 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 26 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 107 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 29 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 35 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 28 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.5 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 122 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 32 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 22 KiB

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

@ -1,8 +1,4 @@
using System;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class AlertsGalleryPage : CoreGalleryBasePage
{

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

@ -1,7 +1,4 @@
using System;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class ImageLoadingGalleryPage : CoreGalleryBasePage
{

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

@ -1,7 +1,4 @@
using System;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class InputTransparencyGalleryPage : CoreGalleryBasePage
{

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

@ -59,6 +59,7 @@
<MauiImage Update="Resources\Images\dotnet_bot.svg" Color="#FFFFFF" BaseSize="168,208" />
<MauiImage Update="Resources\Images\dotnet_bot_resized.svg" Color="#FFFFFF" BaseSize="20,20" />
<MauiImage Update="Resources\Images\dotnet_bot_resized2.svg" Color="#FFFFFF" BaseSize="40,40" />
<MauiImage Update="Resources\Images\dotnet_bot_resized3.svg" Color="#FFFFFF" BaseSize="70,70" />
<MauiImage Include="Resources\Images\dotnet_bot.svg" Link="Resources\Images\small_dotnet_bot.svg" Color="#FFFFFF" BaseSize="64,64" />
<MauiImage Include="Resources\AppIcons\appicon.svg" ForegroundFile="Resources\AppIcons\appicon_foreground.svg" IsAppIcon="true" />
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#FFFFFF" BaseSize="168,208" />

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

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal abstract class CoreGalleryBasePage : CoreGalleryBasePage<View>
{
@ -48,10 +42,10 @@ namespace Maui.Controls.Sample
new Button()
{
Text = "Dismiss Page",
Command = new Command(async () =>
Command = new Command(() =>
{
if (_picker.SelectedIndex == 0)
await Navigation.PopAsync();
Application.Current.Quit();
else
_picker.SelectedIndex--;
})

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

@ -1,7 +1,4 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class CoreGalleryPage<T> : CoreGalleryBasePage<T>
where T : View, new()

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

@ -1,13 +1,9 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
using Microsoft.Maui.Graphics;
using Application = Microsoft.Maui.Controls.Application;
namespace Maui.Controls.Sample
{
[Preserve(AllMembers = true)]
internal class CoreNavigationPage : Microsoft.Maui.Controls.NavigationPage
{
public CoreNavigationPage()

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

@ -1,18 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Controls.Sample.UITests;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Internals;
using Controls.Sample.UITests;
using Maui.Controls.Sample.CollectionViewGalleries;
namespace Maui.Controls.Sample
{
[Preserve(AllMembers = true)]
internal class CorePageView : ListView
{
[Preserve(AllMembers = true)]
internal class GalleryPageFactory
{
public GalleryPageFactory(Func<Page> create, string title)
@ -123,7 +115,7 @@ namespace Maui.Controls.Sample
ItemTemplate = template;
ItemsSource = _pages;
ItemSelected += async (sender, args) =>
ItemSelected += (sender, args) =>
{
if (SelectedItem == null)
{
@ -134,14 +126,8 @@ namespace Maui.Controls.Sample
if (item is GalleryPageFactory page)
{
var realize = page.Realize();
if (realize is Shell)
{
this.Window.Page = realize;
}
else
{
await PushPage(realize);
}
Application.Current.MainPage = realize;
}
SelectedItem = null;

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

@ -1,9 +1,5 @@
using System;
using Microsoft.Maui.Controls.Internals;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
[Preserve(AllMembers = true)]
internal class CoreRootPage : Microsoft.Maui.Controls.ContentPage
{
public CoreRootPage(Microsoft.Maui.Controls.Page rootPage)

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

@ -1,7 +1,4 @@
using System;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class EventViewContainer<T> : ViewContainer<T>
where T : View

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

@ -1,7 +1,4 @@
using System;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class ExpectedEventViewContainer<T> : ViewContainer<T>
where T : View

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

@ -1,6 +1,4 @@
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal interface IViewContainer<out T>
where T : View

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

@ -1,9 +1,4 @@
using System;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Layouts;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class LayeredViewContainer<T> : ViewContainer<T> where T : View
{

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

@ -1,8 +1,5 @@
using System;
using System.ComponentModel;
using System.ComponentModel;
using System.Reflection;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
{

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

@ -1,7 +1,4 @@
using System;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class ValueViewContainer<T> : ViewContainer<T> where T : View
{

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

@ -1,7 +1,4 @@
using System;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class ViewContainer<T> : IViewContainer<T>
where T : View

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

@ -1,6 +1,3 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample;
internal class ActivityIndicatorCoreGalleryPage : CoreGalleryPage<ActivityIndicator>

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

@ -1,8 +1,5 @@
using Microsoft.Maui.Controls.Internals;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
[Preserve(AllMembers = true)]
public class BorderGallery : ContentViewGalleryPage
{
public BorderGallery()

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

@ -1,9 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class BordersWithVariousShapes : ContentView
{
public BordersWithVariousShapes()

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

@ -1,6 +1,3 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample;
internal class BoxViewCoreGalleryPage : CoreGalleryPage<BoxView>

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

@ -1,8 +1,4 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class ButtonCoreGalleryPage : CoreGalleryPage<Button>
{

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

@ -1,12 +1,8 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Windows.Input;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class CarouselViewCoreGalleryPage : ContentPage
{
public CarouselViewCoreGalleryPage()

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

@ -1,7 +1,4 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample
namespace Maui.Controls.Sample
{
internal class CheckBoxCoreGalleryPage : CoreGalleryPage<CheckBox>
{

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

@ -1,9 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class AdaptiveCollectionView : ContentPage
{
public AdaptiveCollectionView()

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

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.CollectionViewGalleries.AlternateLayoutGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.AlternateLayoutGalleries
{
internal class AlternateLayoutGallery : ContentPage
{

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

@ -1,9 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.AlternateLayoutGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.AlternateLayoutGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class StaggeredLayout : ContentPage
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource();

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

@ -1,6 +1,4 @@
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample.CollectionViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries
{
public class CarouselData
{

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

@ -1,8 +1,4 @@
using System;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.CollectionViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries
{
internal abstract class CollectionModifier : ContentView
{

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

@ -1,14 +1,6 @@
using Controls.Sample.UITests;
using Maui.Controls.Sample.CollectionViewGalleries.AlternateLayoutGalleries;
using Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries;
using Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries;
using Maui.Controls.Sample.CollectionViewGalleries.HeaderFooterGalleries;
using Maui.Controls.Sample.CollectionViewGalleries.ItemSizeGalleries;
using Maui.Controls.Sample.CollectionViewGalleries.ReorderingGalleries;
using Maui.Controls.Sample.CollectionViewGalleries.ScrollModeGalleries;
using Maui.Controls.Sample.CollectionViewGalleries.SelectionGalleries;
using Maui.Controls.Sample.CollectionViewGalleries.SpacingGalleries;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.CollectionViewGalleries
{

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

@ -1,13 +1,9 @@
using System;
using System.ComponentModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Internals;
namespace Maui.Controls.Sample.CollectionViewGalleries
{
[Preserve(AllMembers = true)]
public class CollectionViewGalleryTestItem : INotifyPropertyChanged
{
string _caption;

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

@ -1,7 +1,5 @@
using Maui.Controls.Sample.CollectionViewGalleries.DataTemplateSelectorGalleries;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Controls.Sample.UITests;
using Controls.Sample.UITests;
using Maui.Controls.Sample.CollectionViewGalleries.DataTemplateSelectorGalleries;
namespace Maui.Controls.Sample.CollectionViewGalleries
{

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

@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.DataTemplateSelectorGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class VariedSizeDataTemplateSelectorGallery : ContentPage
{
string _index = "1";

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

@ -1,15 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class DataTemplateSelectorGallery : ContentPage
{
DemoFilteredItemSource _demoFilteredItemSource;

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

@ -1,6 +1,4 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Controls.Sample.UITests;
using Controls.Sample.UITests;
namespace Maui.Controls.Sample.CollectionViewGalleries
{

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

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Collections.ObjectModel;
namespace Maui.Controls.Sample.CollectionViewGalleries
{

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

@ -1,6 +1,4 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Controls.Sample.UITests;
using Controls.Sample.UITests;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
@ -35,7 +33,7 @@ namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
TestBuilder.NavButton("EmptyView (load simulation)", () =>
new EmptyViewLoadSimulateGallery(), Navigation),
TestBuilder.NavButton("EmptyView RTL", () =>
new EmptyViewRTLGallery(), Navigation),
new EmptyViewRTLGallery(), Navigation),
}
}
};

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

@ -1,10 +1,9 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.Maui.Controls.Internals;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
[Preserve(AllMembers = true)]
public class EmptyViewGalleryFilterInfo : INotifyPropertyChanged
{
string _filter;

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

@ -1,13 +1,5 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
using Microsoft.Maui.Dispatching;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EmptyViewLoadSimulateGallery : ContentPage
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource();

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

@ -1,15 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EmptyViewNullGallery : ContentPage
{
public EmptyViewNullGallery(bool useOnlyText = true)

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

@ -1,10 +1,5 @@
using System;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EmptyViewRTLGallery : ContentPage
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource();

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

@ -1,9 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EmptyViewStringGallery : ContentPage
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource();

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

@ -1,15 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EmptyViewSwapGallery : ContentPage
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource();

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

@ -1,9 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EmptyViewTemplateGallery : ContentPage
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource();

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

@ -1,15 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.EmptyViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EmptyViewViewGallery : ContentPage
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource();

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

@ -1,8 +1,4 @@
using System;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
namespace Maui.Controls.Sample.CollectionViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries
{
internal class EnumSelector<T> : ContentView where T : struct
{

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

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Devices;
using Microsoft.Maui.Graphics;
using System.Globalization;
namespace Maui.Controls.Sample.CollectionViewGalleries
{

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

@ -1,11 +1,5 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample.CollectionViewGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FilterCollectionView : ContentPage
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource();

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

@ -1,17 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Preserve(AllMembers = true)]
public partial class BasicGrouping : ContentPage
{
public BasicGrouping()

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

@ -1,9 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class GridGrouping : ContentPage
{
public GridGrouping()

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

@ -1,6 +1,4 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Controls.Sample.UITests;
using Controls.Sample.UITests;
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
{
@ -33,7 +31,7 @@ namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
TestBuilder.NavButton("Grouping, Observable", () =>
new ObservableGrouping(), Navigation),
TestBuilder.NavButton("Grouping, Grid", () =>
new GridGrouping(), Navigation),
new GridGrouping(), Navigation),
}
}
};

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

@ -1,15 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class GroupingNoTemplates : ContentPage
{
public GroupingNoTemplates()

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

@ -1,15 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class GroupingPlusSelection : ContentPage
{
public GroupingPlusSelection()

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

@ -1,15 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MeasureFirstStrategy : ContentPage
{
public MeasureFirstStrategy()

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

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
{
internal class ObservableGrouping : ContentPage
{

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

@ -1,10 +1,5 @@
using System.Collections.Generic;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
namespace Maui.Controls.Sample.CollectionViewGalleries.GroupingGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SomeEmptyGroups : ContentPage
{
public SomeEmptyGroups()

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