Skip to content

Commit

Permalink
chore: Adjust after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Nov 28, 2021
1 parent 87e9e01 commit 9ae8303
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -924,82 +924,6 @@ public void When_ThemeResource_And_Setter_And_Theme_Changed()

}

[TestMethod]
public void When_Resources_And_Empty()
{
var s = "<Grid xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' > <Grid.Resources ></Grid.Resources ></Grid > ";
var r = Windows.UI.Xaml.Markup.XamlReader.Load(s) as Grid;
Assert.IsNotNull(r.Resources);
}

[TestMethod]
public void When_StaticResource_And_NonDependencyProperty()
{
var app = UnitTestsApp.App.EnsureApplication();
app.Resources["MyIntResource"] = 77;
try
{
var s = GetContent(nameof(When_StaticResource_And_NonDependencyProperty));
var r = Windows.UI.Xaml.Markup.XamlReader.Load(s) as Page;

var root = r.FindName("root") as Grid;
var inner = root.Children.First() as NonDependencyPropertyAssignable;

Assert.AreEqual(77, inner.MyProperty);
}
finally
{
app.Resources.Remove("MyDoubleResource");
}

}

[TestMethod]
public void When_ThemeResource_And_Setter_And_Theme_Changed()
{
var app = UnitTestsApp.App.EnsureApplication();
var themeDict = new ResourceDictionary
{
ThemeDictionaries =
{
{"Light", new ResourceDictionary
{
{"MyIntResourceThemed", 244 }
}
},
{"Dark", new ResourceDictionary
{
{"MyIntResourceThemed", 9 }
}
},
}
};
app.Resources.MergedDictionaries.Add(themeDict);
try
{
var s = GetContent(nameof(When_ThemeResource_And_Setter_And_Theme_Changed));
var r = Windows.UI.Xaml.Markup.XamlReader.Load(s) as Page;

var root = r.FindName("root") as Grid;
var inner = root.Children.First() as Button;

app.HostView.Children.Add(r);

Assert.AreEqual(ApplicationTheme.Light, app.RequestedTheme);
Assert.AreEqual(244, inner.Tag);

app.SetExplicitRequestedTheme(ApplicationTheme.Dark);
Assert.AreEqual(ApplicationTheme.Dark, app.RequestedTheme);
Assert.AreEqual(9, inner.Tag);
}
finally
{
app.SetExplicitRequestedTheme(null);
app.Resources.MergedDictionaries.Remove(themeDict);
}

}

[TestMethod]
public void When_xName_Reload()
{
Expand Down
1 change: 0 additions & 1 deletion src/Uno.UI/UI/Xaml/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#else
using View = Windows.UI.Xaml.UIElement;
using ViewGroup = Windows.UI.Xaml.UIElement;
using System.Collections.Generic;
#endif

namespace Windows.UI.Xaml
Expand Down

0 comments on commit 9ae8303

Please sign in to comment.