-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return ContentAsString when a template isn't specified
- Loading branch information
Showing
4 changed files
with
140 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
src/Controls/tests/TestCases.HostApp/Issues/Issue25887.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue25887" | ||
Title="Issue 25887"> | ||
<ContentPage.Resources> | ||
|
||
<ControlTemplate x:Key="RadioButtonTemplate"> | ||
<ContentPresenter /> | ||
</ControlTemplate> | ||
|
||
<Style x:Key="RadioButtonStyle" TargetType="RadioButton"> | ||
<Setter Property="ControlTemplate" | ||
Value="{StaticResource RadioButtonTemplate}" /> | ||
</Style> | ||
|
||
</ContentPage.Resources> | ||
<StackLayout | ||
Padding="12"> | ||
<Label | ||
Text="Using ControlTemplate" /> | ||
<StackLayout | ||
RadioButtonGroup.GroupName="template"> | ||
<RadioButton | ||
IsChecked="True" | ||
AutomationId="RadioButtonTemplate1" | ||
Value="Template 1" | ||
Style="{StaticResource RadioButtonStyle}"> | ||
<RadioButton.Content> | ||
<StackLayout> | ||
<Image | ||
Source="coffee.png" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" /> | ||
<Label | ||
AutomationId="Success" | ||
Text="Template 1" | ||
HorizontalOptions="Center" | ||
VerticalOptions="End" /> | ||
</StackLayout> | ||
</RadioButton.Content> | ||
</RadioButton> | ||
<RadioButton | ||
AutomationId="RadioButtonTemplate2" | ||
Value="Template 2" | ||
Style="{StaticResource RadioButtonStyle}"> | ||
<RadioButton.Content> | ||
<StackLayout> | ||
<Image | ||
Source="coffee.png" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" /> | ||
<Label | ||
Text="Template 2" | ||
HorizontalOptions="Center" | ||
VerticalOptions="End" /> | ||
</StackLayout> | ||
</RadioButton.Content> | ||
</RadioButton> | ||
<RadioButton | ||
AutomationId="RadioButtonTemplate3" | ||
Value="Template 3" | ||
Style="{StaticResource RadioButtonStyle}"> | ||
<RadioButton.Content> | ||
<StackLayout> | ||
<Image | ||
Source="coffee.png" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" /> | ||
<Label | ||
Text="Template 3" | ||
HorizontalOptions="Center" | ||
VerticalOptions="End" /> | ||
</StackLayout> | ||
</RadioButton.Content> | ||
</RadioButton> | ||
<RadioButton | ||
AutomationId="RadioButtonTemplate4" | ||
Value="Template 4" | ||
Style="{StaticResource RadioButtonStyle}"> | ||
<RadioButton.Content> | ||
<StackLayout> | ||
<Image | ||
Source="coffee.png" | ||
HorizontalOptions="Center" | ||
VerticalOptions="Center" /> | ||
<Label | ||
Text="Template 4" | ||
HorizontalOptions="Center" | ||
VerticalOptions="End" /> | ||
</StackLayout> | ||
</RadioButton.Content> | ||
</RadioButton> | ||
</StackLayout> | ||
</StackLayout> | ||
</ContentPage> |
10 changes: 10 additions & 0 deletions
10
src/Controls/tests/TestCases.HostApp/Issues/Issue25887.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[Issue(IssueTracker.Github, 25887, "ContentPresenter just rendering component string in .Net9", PlatformAffected.Android)] | ||
public partial class Issue25887 : ContentPage | ||
{ | ||
public Issue25887() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25887.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue25887 : _IssuesUITest | ||
{ | ||
public Issue25887(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "ContentPresenter just rendering component string in .Net9"; | ||
|
||
[Test] | ||
[Category(UITestCategories.RadioButton)] | ||
public void RadioButtonContentNotRendering() | ||
{ | ||
App.WaitForElement("Success"); | ||
} | ||
} | ||
} |