Example #1
0
        public void VerifyVisualTreeForCommandBarCornerRadius()
        {
            if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5))
            {
                return;
            }

            var xaml =
                @"<StackPanel Width='400' Height='400' xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
                    xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> 
                        <CommandBar Background='Green' CornerRadius='10,10,10,10' IsOpen='True'>
                        <AppBarToggleButton Icon='Shuffle' Label='Shuffle'  />
                        <AppBarToggleButton Icon='RepeatAll' Label='Repeat' />
                        <AppBarSeparator Margin='20,10,20,0' Foreground='Yellow'/>
        
                        <CommandBar.Content>
                            <TextBlock Text='Now playing...' Margin='12,14'/>
                        </CommandBar.Content>
                        </CommandBar>

                        <CommandBar Background='Green' CornerRadius='5,10,5,10' IsOpen='False'>
                        <AppBarToggleButton Icon='Shuffle' Label='Shuffle'  />
                        <AppBarToggleButton Icon='RepeatAll' Label='Repeat' />
                        <AppBarSeparator Margin='20,10,20,0' Padding='16,12,15,12' Foreground='Yellow'/>

                        <CommandBar.Content>
                            <TextBlock Text='Now playing...' Margin='12,14'/>
                        </CommandBar.Content>
                        </CommandBar>
                    </StackPanel>";

            VisualTreeTestHelper.VerifyVisualTree(xaml: xaml,
                                                  verificationFileNamePrefix: "VerifyVisualTreeForCommandBarCornerRadius");
        }
Example #2
0
        public void VerifyAllV1KeysExistInV2()
        {
            if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5))
            {
                // https://github.com/microsoft/microsoft-ui-xaml/issues/4674
                Log.Comment("Skipping validation below RS5.");
                return;
            }

            RunOnUIThread.Execute(() =>
            {
                var v1 = new XamlControlsResources()
                {
                    ControlsResourcesVersion = ControlsResourcesVersion.Version1
                };
                var v2 = new XamlControlsResources()
                {
                    ControlsResourcesVersion = ControlsResourcesVersion.Version2
                };

                Verify.IsTrue(AreKeysFromExpectedInActualDictionary(
                                  (ResourceDictionary)v1.ThemeDictionaries["Default"],
                                  "V1.ThemeDictionaries.Default",
                                  (ResourceDictionary)v2.ThemeDictionaries["Default"],
                                  "V2.ThemeDictionaries.Default"),
                              "Resource Keys in V1 Default theme dictionary do not exist in V2 Default theme dictionary");

                Verify.IsTrue(AreKeysFromExpectedInActualDictionary(
                                  (ResourceDictionary)v1.ThemeDictionaries["Light"],
                                  "V1.ThemeDictionaries.Light",
                                  (ResourceDictionary)v2.ThemeDictionaries["Light"],
                                  "V2.ThemeDictionaries.Light"),
                              "Resource Keys in V1 Light theme dictionary do not exist in V2 Light theme dictionary");

                Verify.IsTrue(AreKeysFromExpectedInActualDictionary(
                                  (ResourceDictionary)v1.ThemeDictionaries["HighContrast"],
                                  "V1.ThemeDictionaries.HighContrast",
                                  (ResourceDictionary)v2.ThemeDictionaries["HighContrast"],
                                  "V2.ThemeDictionaries.HighContrast"),
                              "Resource Keys in V1 HighContrast theme dictionary do not exist in V2 HighContrast theme dictionary");

                Verify.IsTrue(AreKeysFromExpectedInActualDictionary(
                                  (ResourceDictionary)v1,
                                  "V1.RootDictionary",
                                  (ResourceDictionary)v2,
                                  "V2.RootDictionary"),
                              "Resource Keys in V1 root dictionary do not exist in V2 root dictionary");
            });
        }
Example #3
0
        public void VerifyNoResourceKeysWereRemovedFromPreviousStableReleaseInV2Styles()
        {
            if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5))
            {
                // https://github.com/microsoft/microsoft-ui-xaml/issues/4674
                Log.Comment("Skipping validation below RS5.");
                return;
            }

            RunOnUIThread.Execute(() =>
            {
                EnsureNoMissingThemeResources(
                    BaselineResources.BaselineResourcesList2dot5Stable,
                    new XamlControlsResources()
                {
                    ControlsResourcesVersion = ControlsResourcesVersion.Version2
                });
            });
        }