-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ProgressBar Track overridable. (#6061)
- Loading branch information
1 parent
62de7e8
commit 3ca462c
Showing
6 changed files
with
106 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
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,70 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using Common; | ||
using Microsoft.UI.Xaml.Controls; | ||
using MUXControlsTestApp.Utilities; | ||
using Microsoft.UI.Xaml.Automation.Peers; | ||
using Windows.UI.Xaml.Automation.Provider; | ||
using Windows.UI.Xaml.Automation.Peers; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Automation; | ||
using Windows.UI.Xaml.Shapes; | ||
using Windows.UI.Xaml.Markup; | ||
using Windows.UI.Xaml.Controls; | ||
#if USING_TAEF | ||
using WEX.TestExecution; | ||
using WEX.TestExecution.Markup; | ||
using WEX.Logging.Interop; | ||
#else | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting.Logging; | ||
#endif | ||
|
||
namespace Windows.UI.Xaml.Tests.MUXControls.ApiTests | ||
{ | ||
[TestClass] | ||
public class ProgressBarTests : ApiTestBase | ||
{ | ||
[TestMethod] | ||
public void ResourceOverridablity() | ||
{ | ||
RunOnUIThread.Execute(() => | ||
{ | ||
var root = (StackPanel)XamlReader.Load( | ||
@"<StackPanel xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' | ||
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' | ||
xmlns:primitives='using:Microsoft.UI.Xaml.Controls.Primitives' | ||
xmlns:controls='using:Microsoft.UI.Xaml.Controls'> | ||
<Grid> | ||
<Grid.Resources> | ||
<x:Double x:Key='ProgressBarTrackHeight'>3</x:Double> | ||
</Grid.Resources> | ||
<controls:ProgressBar/> | ||
</Grid> | ||
<controls:ProgressBar/> | ||
</StackPanel>"); | ||
Content = root; | ||
Content.UpdateLayout(); | ||
var grid = VisualTreeHelper.GetChild(root, 0); | ||
var progressBar1 = VisualTreeHelper.GetChild(grid, 0); | ||
var templateRoot1 = VisualTreeHelper.GetChild(progressBar1, 0); | ||
var Border11 = VisualTreeHelper.GetChild(templateRoot1, 0); | ||
var Border12 = VisualTreeHelper.GetChild(Border11, 0); | ||
var grid1 = VisualTreeHelper.GetChild(Border12, 0); | ||
var rect1 = VisualTreeHelper.GetChild(grid1, 0) as Rectangle; | ||
Verify.AreEqual(3, rect1.Height); | ||
var progressBar2 = VisualTreeHelper.GetChild(root, 1); | ||
var templateRoot2 = VisualTreeHelper.GetChild(progressBar2, 0); | ||
var Border21 = VisualTreeHelper.GetChild(templateRoot2, 0); | ||
var Border22 = VisualTreeHelper.GetChild(Border21, 0); | ||
var grid2 = VisualTreeHelper.GetChild(Border22, 0); | ||
var rect2 = VisualTreeHelper.GetChild(grid2, 0) as Rectangle; | ||
Verify.AreEqual(1, rect2.Height); | ||
}); | ||
} | ||
} | ||
} |
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,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> | ||
<HasSharedItems>true</HasSharedItems> | ||
<SharedGUID>dd024665-31da-4290-993e-2e46eb370c77</SharedGUID> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Configuration"> | ||
<Import_RootNamespace>ProgressBar_APITests</Import_RootNamespace> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildThisFileDirectory)ProgressBarTests.cs" /> | ||
</ItemGroup> | ||
</Project> |
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>dd024665-31da-4290-993e-2e46eb370c77</ProjectGuid> | ||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" /> | ||
<PropertyGroup /> | ||
<Import Project="ProgressBar_APITests.projitems" Label="Shared" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" /> | ||
</Project> |
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
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