Skip to content

Commit

Permalink
Merge pull request #3036 from unoplatform/dev/jela/sealed-default
Browse files Browse the repository at this point in the history
fix: Remove the sealed attribute from generated code (#2830)
  • Loading branch information
jeromelaban authored Apr 23, 2020
2 parents 02068b0 + 2e80728 commit 436fe9d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ private string InnerGenerateFile()

var controlBaseType = GetType(topLevelControl.Type);

using (writer.BlockInvariant("public sealed partial class {0} : {1}", _className.className, controlBaseType.ToDisplayString()))
using (writer.BlockInvariant("public partial class {0} : {1}", _className.className, controlBaseType.ToDisplayString()))
{
var isDirectUserControlChild = IsUserControl(topLevelControl.Type, checkInheritance: false);

Expand Down
14 changes: 14 additions & 0 deletions src/SourceGenerators/XamlGenerationTests/InheritingPageTest.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Page
x:Class="XamlGenerationTests.InheritingPageTest"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XamlGenerationTests"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>

</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238

namespace XamlGenerationTests
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public partial class InheritingPageTest : Page
{
public InheritingPageTest()
{
this.InitializeComponent();
}
}

public partial class InheritingPageTest2 : InheritingPageTest
{

}
}

0 comments on commit 436fe9d

Please sign in to comment.