Skip to content

Commit bd997fc

Browse files
jfversluisgithub-actions
authored and
github-actions
committed
Revert "Remove InternalsVisibleTo for Toolkit (#28994)"
This reverts commit 504aa86.
1 parent c1153ff commit bd997fc

File tree

15 files changed

+68
-249
lines changed

15 files changed

+68
-249
lines changed
+8-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
namespace Microsoft.Maui.Controls;
2-
3-
/// <summary>
4-
/// Defines properties for elements that can have rounded corners.
5-
/// </summary>
6-
/// <remarks>
7-
/// This interface is implemented by UI elements that support corner radius customization,
8-
/// allowing for consistent styling of corners across different controls.
9-
/// </remarks>
10-
public interface ICornerElement
1+
#nullable disable
2+
namespace Microsoft.Maui.Controls
113
{
12-
/// <summary>
13-
/// Gets the radius for the corners of the element.
14-
/// </summary>
15-
/// <value>A <see cref="CornerRadius"/> value that specifies the radius for each corner of the element. The default value depends on the implementing control.</value>
16-
/// <remarks>Implementors should implement this property publicly.</remarks>
17-
CornerRadius CornerRadius { get; }
18-
}
4+
interface ICornerElement
5+
{
6+
//note to implementor: implement this property publicly
7+
CornerRadius CornerRadius { get; }
8+
}
9+
}
+10-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
namespace Microsoft.Maui.Controls;
1+
#nullable disable
2+
using System.ComponentModel;
23

3-
/// <summary>
4-
/// Defines properties and methods for elements that support line height customization.
5-
/// </summary>
6-
/// <remarks>
7-
/// This interface is implemented by UI elements that need to control the spacing between lines of text,
8-
/// providing consistent line height behavior across different text-based controls.
9-
/// </remarks>
10-
public interface ILineHeightElement
4+
namespace Microsoft.Maui.Controls.Internals
115
{
12-
/// <summary>
13-
/// Gets the line height for text displayed by this element.
14-
/// </summary>
15-
/// <value>A multiplier that determines the spacing between lines of text. A value of 1.0 represents standard line height.</value>
16-
double LineHeight { get; }
6+
[EditorBrowsable(EditorBrowsableState.Never)]
7+
interface ILineHeightElement
8+
{
9+
double LineHeight { get; }
1710

18-
/// <summary>
19-
/// Called when the <see cref="LineHeight"/> property changes.
20-
/// </summary>
21-
/// <param name="oldValue">The old value of the property.</param>
22-
/// <param name="newValue">The new value of the property.</param>
23-
/// <remarks>Implementors should implement this method explicitly.</remarks>
24-
void OnLineHeightChanged(double oldValue, double newValue);
25-
}
11+
void OnLineHeightChanged(double oldValue, double newValue);
12+
}
13+
}
+11-30
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,14 @@
1-
namespace Microsoft.Maui.Controls;
2-
3-
/// <summary>
4-
/// Defines properties and methods for elements that support text alignment.
5-
/// </summary>
6-
/// <remarks>
7-
/// This interface is implemented by UI elements that need to control the horizontal and vertical
8-
/// alignment of displayed text.
9-
/// </remarks>
10-
public interface ITextAlignmentElement
1+
#nullable disable
2+
namespace Microsoft.Maui.Controls
113
{
12-
/// <summary>
13-
/// Gets the horizontal alignment of the text.
14-
/// </summary>
15-
/// <value>A <see cref="TextAlignment"/> value that specifies how the text is horizontally aligned. The default value depends on the implementing control.</value>
16-
/// <remarks>Implementors should implement this property publicly.</remarks>
17-
TextAlignment HorizontalTextAlignment { get; }
4+
interface ITextAlignmentElement
5+
{
6+
//note to implementor: implement the properties publicly
7+
TextAlignment HorizontalTextAlignment { get; }
188

19-
/// <summary>
20-
/// Gets the vertical alignment of the text.
21-
/// </summary>
22-
/// <value>A <see cref="TextAlignment"/> value that specifies how the text is vertically aligned. The default value depends on the implementing control.</value>
23-
/// <remarks>Implementors should implement this property publicly.</remarks>
24-
TextAlignment VerticalTextAlignment { get; }
9+
TextAlignment VerticalTextAlignment { get; }
2510

26-
/// <summary>
27-
/// Called when the <see cref="HorizontalTextAlignment"/> property changes.
28-
/// </summary>
29-
/// <param name="oldValue">The old value of the property.</param>
30-
/// <param name="newValue">The new value of the property.</param>
31-
/// <remarks>Implementors should implement this method explicitly.</remarks>
32-
void OnHorizontalTextAlignmentPropertyChanged(TextAlignment oldValue, TextAlignment newValue);
33-
}
11+
//note to implementor: but implement the methods explicitly
12+
void OnHorizontalTextAlignmentPropertyChanged(TextAlignment oldValue, TextAlignment newValue);
13+
}
14+
}

src/Controls/src/Core/ITextElement.cs

+17-54
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,27 @@
11
#nullable disable
2+
using System;
3+
using Microsoft.Maui.Controls.Internals;
24
using Microsoft.Maui.Graphics;
35

4-
namespace Microsoft.Maui.Controls;
5-
6-
/// <summary>
7-
/// Defines properties and methods for elements that display text.
8-
/// </summary>
9-
/// <remarks>
10-
/// This interface is implemented by UI elements that can display text and allows consistent
11-
/// text styling and formatting across different controls.
12-
/// </remarks>
13-
public interface ITextElement
6+
namespace Microsoft.Maui.Controls
147
{
15-
/// <summary>
16-
/// Gets the color of the text.
17-
/// </summary>
18-
/// <value>The <see cref="Color"/> of the text. The default value depends on the implementing control.</value>
19-
/// <remarks>Implementors should implement this property publicly.</remarks>
20-
Color TextColor { get; }
8+
interface ITextElement
9+
{
10+
//note to implementor: implement this property publicly
11+
Color TextColor { get; }
2112

22-
/// <summary>
23-
/// Called when the <see cref="TextColor"/> property changes.
24-
/// </summary>
25-
/// <param name="oldValue">The old value of the property.</param>
26-
/// <param name="newValue">The new value of the property.</param>
27-
/// <remarks>Implementors should implement this method explicitly.</remarks>
28-
void OnTextColorPropertyChanged(Color oldValue, Color newValue);
13+
//note to implementor: but implement this method explicitly
14+
void OnTextColorPropertyChanged(Color oldValue, Color newValue);
2915

30-
/// <summary>
31-
/// Gets the character spacing.
32-
/// </summary>
33-
/// <value>The spacing between characters in the text, in device-independent units. The default is 0.</value>
34-
double CharacterSpacing { get; }
16+
double CharacterSpacing { get; }
3517

36-
/// <summary>
37-
/// Called when the <see cref="CharacterSpacing"/> property changes.
38-
/// </summary>
39-
/// <param name="oldValue">The old value of the property.</param>
40-
/// <param name="newValue">The new value of the property.</param>
41-
/// <remarks>Implementors should implement this method explicitly.</remarks>
42-
void OnCharacterSpacingPropertyChanged(double oldValue, double newValue);
18+
//note to implementor: but implement these methods explicitly
19+
void OnCharacterSpacingPropertyChanged(double oldValue, double newValue);
4320

44-
/// <summary>
45-
/// Gets or sets the text transformation.
46-
/// </summary>
47-
/// <value>A <see cref="TextTransform"/> value that indicates how the text is transformed. The default is <see cref="TextTransform.None"/>.</value>
48-
TextTransform TextTransform { get; set; }
21+
TextTransform TextTransform { get; set; }
4922

50-
/// <summary>
51-
/// Called when the <see cref="TextTransform"/> property changes.
52-
/// </summary>
53-
/// <param name="oldValue">The old value of the property.</param>
54-
/// <param name="newValue">The new value of the property.</param>
55-
void OnTextTransformChanged(TextTransform oldValue, TextTransform newValue);
23+
void OnTextTransformChanged(TextTransform oldValue, TextTransform newValue);
5624

57-
/// <summary>
58-
/// Updates the text according to the specified transformation.
59-
/// </summary>
60-
/// <param name="original">The original text to transform.</param>
61-
/// <param name="transform">The transformation to apply.</param>
62-
/// <returns>The transformed text.</returns>
63-
string UpdateFormsText(string original, TextTransform transform);
64-
}
25+
string UpdateFormsText(string original, TextTransform transform);
26+
}
27+
}

src/Controls/src/Core/Properties/AssemblyInfo.cs

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
[assembly: InternalsVisibleTo("Microsoft.Maui.Controls.DeviceTests")]
4949
[assembly: InternalsVisibleTo("Controls.TestCases.HostApp")]
5050

51+
[assembly: InternalsVisibleTo("CommunityToolkit.Maui")]
52+
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.Core")]
53+
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.Embedding")]
54+
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.UnitTests")]
55+
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.Markup")]
56+
[assembly: InternalsVisibleTo("CommunityToolkit.Maui.Markup.UnitTests")]
5157
[assembly: InternalsVisibleTo("Controls.TestCases.HostApp")]
5258

5359
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt

-18
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,7 @@ Microsoft.Maui.Controls.DatePicker.MaximumDate.get -> System.DateTime?
2323
Microsoft.Maui.Controls.DatePicker.MinimumDate.get -> System.DateTime?
2424
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task!
2525
Microsoft.Maui.Controls.HybridWebView.SetInvokeJavaScriptTarget<T>(T! target) -> void
26-
Microsoft.Maui.Controls.ICornerElement
27-
Microsoft.Maui.Controls.ICornerElement.CornerRadius.get -> Microsoft.Maui.CornerRadius
28-
Microsoft.Maui.Controls.ILineHeightElement
29-
Microsoft.Maui.Controls.ILineHeightElement.LineHeight.get -> double
30-
Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, double newValue) -> void
3126
Microsoft.Maui.Controls.Internals.TextTransformUtilities
32-
Microsoft.Maui.Controls.ITextAlignmentElement
33-
Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
34-
Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
35-
Microsoft.Maui.Controls.ITextAlignmentElement.VerticalTextAlignment.get -> Microsoft.Maui.TextAlignment
36-
Microsoft.Maui.Controls.ITextElement
37-
Microsoft.Maui.Controls.ITextElement.CharacterSpacing.get -> double
38-
Microsoft.Maui.Controls.ITextElement.OnCharacterSpacingPropertyChanged(double oldValue, double newValue) -> void
39-
Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextTransform oldValue, Microsoft.Maui.TextTransform newValue) -> void
40-
Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform
41-
Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void
42-
~Microsoft.Maui.Controls.ITextElement.OnTextColorPropertyChanged(Microsoft.Maui.Graphics.Color oldValue, Microsoft.Maui.Graphics.Color newValue) -> void
43-
~Microsoft.Maui.Controls.ITextElement.TextColor.get -> Microsoft.Maui.Graphics.Color
44-
~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string
4527
Microsoft.Maui.Controls.ShadowTypeConverter
4628
Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void
4729
Microsoft.Maui.Controls.StyleableElement.Style.get -> Microsoft.Maui.Controls.Style?

src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt

-18
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,6 @@ static Microsoft.Maui.Controls.ViewExtensions.TranslateToAsync(this Microsoft.Ma
105105
*REMOVED*~Microsoft.Maui.Controls.NavigableElement.StyleClass.set -> void
106106
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task!
107107
Microsoft.Maui.Controls.HybridWebView.SetInvokeJavaScriptTarget<T>(T! target) -> void
108-
Microsoft.Maui.Controls.ICornerElement
109-
Microsoft.Maui.Controls.ICornerElement.CornerRadius.get -> Microsoft.Maui.CornerRadius
110-
Microsoft.Maui.Controls.ILineHeightElement
111-
Microsoft.Maui.Controls.ILineHeightElement.LineHeight.get -> double
112-
Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, double newValue) -> void
113-
Microsoft.Maui.Controls.ITextAlignmentElement
114-
Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
115-
Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
116-
Microsoft.Maui.Controls.ITextAlignmentElement.VerticalTextAlignment.get -> Microsoft.Maui.TextAlignment
117-
Microsoft.Maui.Controls.ITextElement
118-
Microsoft.Maui.Controls.ITextElement.CharacterSpacing.get -> double
119-
Microsoft.Maui.Controls.ITextElement.OnCharacterSpacingPropertyChanged(double oldValue, double newValue) -> void
120-
Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextTransform oldValue, Microsoft.Maui.TextTransform newValue) -> void
121-
Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform
122-
Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void
123-
~Microsoft.Maui.Controls.ITextElement.OnTextColorPropertyChanged(Microsoft.Maui.Graphics.Color oldValue, Microsoft.Maui.Graphics.Color newValue) -> void
124-
~Microsoft.Maui.Controls.ITextElement.TextColor.get -> Microsoft.Maui.Graphics.Color
125-
~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string
126108
~Microsoft.Maui.Controls.ResourceDictionary.SetAndCreateSource<T>(System.Uri value) -> void
127109
~Microsoft.Maui.Controls.WebViewProcessTerminatedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewProcessTerminatedEventArgs
128110
~Microsoft.Maui.Controls.Xaml.IXamlTypeResolver.Resolve(string qualifiedTypeName, System.IServiceProvider serviceProvider = null, bool expandToExtension = true) -> System.Type

src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt

-18
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,6 @@ static Microsoft.Maui.Controls.ViewExtensions.TranslateToAsync(this Microsoft.Ma
105105
*REMOVED*~Microsoft.Maui.Controls.NavigableElement.StyleClass.set -> void
106106
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task!
107107
Microsoft.Maui.Controls.HybridWebView.SetInvokeJavaScriptTarget<T>(T! target) -> void
108-
Microsoft.Maui.Controls.ICornerElement
109-
Microsoft.Maui.Controls.ICornerElement.CornerRadius.get -> Microsoft.Maui.CornerRadius
110-
Microsoft.Maui.Controls.ILineHeightElement
111-
Microsoft.Maui.Controls.ILineHeightElement.LineHeight.get -> double
112-
Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, double newValue) -> void
113-
Microsoft.Maui.Controls.ITextAlignmentElement
114-
Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
115-
Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
116-
Microsoft.Maui.Controls.ITextAlignmentElement.VerticalTextAlignment.get -> Microsoft.Maui.TextAlignment
117-
Microsoft.Maui.Controls.ITextElement
118-
Microsoft.Maui.Controls.ITextElement.CharacterSpacing.get -> double
119-
Microsoft.Maui.Controls.ITextElement.OnCharacterSpacingPropertyChanged(double oldValue, double newValue) -> void
120-
Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextTransform oldValue, Microsoft.Maui.TextTransform newValue) -> void
121-
Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform
122-
Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void
123-
~Microsoft.Maui.Controls.ITextElement.OnTextColorPropertyChanged(Microsoft.Maui.Graphics.Color oldValue, Microsoft.Maui.Graphics.Color newValue) -> void
124-
~Microsoft.Maui.Controls.ITextElement.TextColor.get -> Microsoft.Maui.Graphics.Color
125-
~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string
126108
~Microsoft.Maui.Controls.ResourceDictionary.SetAndCreateSource<T>(System.Uri value) -> void
127109
~Microsoft.Maui.Controls.Internals.TypedBindingBase.UpdateSourceEventName.set -> void
128110
~Microsoft.Maui.Controls.Xaml.IXamlTypeResolver.Resolve(string qualifiedTypeName, System.IServiceProvider serviceProvider = null, bool expandToExtension = true) -> System.Type

src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt

-18
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,7 @@ Microsoft.Maui.Controls.DatePicker.MaximumDate.get -> System.DateTime?
2323
Microsoft.Maui.Controls.DatePicker.MinimumDate.get -> System.DateTime?
2424
Microsoft.Maui.Controls.HybridWebView.InvokeJavaScriptAsync(string! methodName, object?[]? paramValues = null, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = null) -> System.Threading.Tasks.Task!
2525
Microsoft.Maui.Controls.HybridWebView.SetInvokeJavaScriptTarget<T>(T! target) -> void
26-
Microsoft.Maui.Controls.ICornerElement
27-
Microsoft.Maui.Controls.ICornerElement.CornerRadius.get -> Microsoft.Maui.CornerRadius
28-
Microsoft.Maui.Controls.ILineHeightElement
29-
Microsoft.Maui.Controls.ILineHeightElement.LineHeight.get -> double
30-
Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, double newValue) -> void
3126
Microsoft.Maui.Controls.Internals.TextTransformUtilities
32-
Microsoft.Maui.Controls.ITextAlignmentElement
33-
Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment
34-
Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void
35-
Microsoft.Maui.Controls.ITextAlignmentElement.VerticalTextAlignment.get -> Microsoft.Maui.TextAlignment
36-
Microsoft.Maui.Controls.ITextElement
37-
Microsoft.Maui.Controls.ITextElement.CharacterSpacing.get -> double
38-
Microsoft.Maui.Controls.ITextElement.OnCharacterSpacingPropertyChanged(double oldValue, double newValue) -> void
39-
Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextTransform oldValue, Microsoft.Maui.TextTransform newValue) -> void
40-
Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform
41-
Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void
42-
~Microsoft.Maui.Controls.ITextElement.OnTextColorPropertyChanged(Microsoft.Maui.Graphics.Color oldValue, Microsoft.Maui.Graphics.Color newValue) -> void
43-
~Microsoft.Maui.Controls.ITextElement.TextColor.get -> Microsoft.Maui.Graphics.Color
44-
~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string
4527
Microsoft.Maui.Controls.ShadowTypeConverter
4628
Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void
4729
Microsoft.Maui.Controls.StyleableElement.Style.get -> Microsoft.Maui.Controls.Style?

0 commit comments

Comments
 (0)