Skip to content

Commit

Permalink
Merge branch 'fixes/osx-multi-monitor-working-area-calc' of github.co…
Browse files Browse the repository at this point in the history
…m:AvaloniaUI/Avalonia into fixes/osx-multi-monitor-working-area-calc
  • Loading branch information
danwalmsley committed Feb 7, 2021
2 parents bd159fb + 11e81fe commit 4cf6231
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ public IXamlAstNode Transform(AstTransformationContext context, IXamlAstNode nod
{
if (d.Namespace == XamlNamespaces.Xaml2006)
{
if (d.Name == "Precompile" || d.Name == "Class")
if (d.Name == "Precompile" ||
d.Name == "Class" ||
d.Name == "FieldModifier" ||
d.Name == "ClassModifier")
no.Children.Remove(d);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
using Avalonia.UnitTests;
using Xunit;

namespace Avalonia.Markup.Xaml.UnitTests.Xaml
{
public class IgnoredDirectivesTests : XamlTestBase
{
[Fact]
public void Ignored_Directives_Should_Compile()
{
using (UnitTestApplication.Start(TestServices.StyledWindow))
{
const string xaml = @"
<Window xmlns='https://github.com/avaloniaui'
xmlns:sys='clr-namespace:System;assembly=netstandard'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
<TextBlock x:Name='target' x:FieldModifier='Public' Text='Foo'/>
</Window>";
var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml);
var target = window.FindControl<TextBlock>("target");

window.ApplyTemplate();
target.ApplyTemplate();

Assert.Equal("Foo", target.Text);
}
}
}
}

0 comments on commit 4cf6231

Please sign in to comment.