示例#1
0
        public void AnimatedIconSourceTest()
        {
            AnimatedIconSource     iconSource = null;
            IAnimatedVisualSource2 source     = null;

            RunOnUIThread.Execute(() =>
            {
                iconSource = new AnimatedIconSource();
                source     = new AnimatedChevronDownSmallVisualSource();

                // IconSource.Foreground should be null to allow foreground inheritance from
                // the parent to work.
                Verify.AreEqual(iconSource.Foreground, null);

                Log.Comment("Validate the defaults match BitmapIcon.");

                var icon = new AnimatedIcon();
                Verify.AreEqual(icon.Source, iconSource.Source);

                Log.Comment("Validate that you can change the properties.");

                iconSource.Foreground = new SolidColorBrush(Windows.UI.Colors.Red);
                iconSource.Source     = source;
            });
            IdleSynchronizer.Wait();

            RunOnUIThread.Execute(() =>
            {
                Verify.IsTrue(iconSource.Foreground is SolidColorBrush);
                Verify.AreEqual(Windows.UI.Colors.Red, (iconSource.Foreground as SolidColorBrush).Color);
                Verify.AreEqual(source, iconSource.Source);
            });
        }
示例#2
0
        public SettingsSearchPage(Type page, string text, IAnimatedVisualSource2 icon = null, SettingsSearchEntry[] items = null)
            : base(text, icon)
        {
            Page  = page;
            Items = items;

            if (items != null)
            {
                foreach (var item in items)
                {
                    item.Parent = this;

                    if (item.Icon == null)
                    {
                        item.Icon = icon;
                    }
                }
            }
        }
示例#3
0
        public DownloadsIndicator()
        {
            DefaultStyleKey = typeof(DownloadsIndicator);

            var compositor = Window.Current.Compositor;
            var source     = new Downloading();

            var visual = source.TryCreateAnimatedVisual(compositor, out _);

            if (visual == null)
            {
                return;
            }

            _visual = visual;
            _visual.RootVisual.Scale = new System.Numerics.Vector3(0.1f, 0.1f, 1);
            _visualSource            = source;

            ThemeChanged();

            var linearEasing = compositor.CreateLinearEasingFunction();

            _animation          = compositor.CreateScalarKeyFrameAnimation();
            _animation.Duration = visual.Duration;
            _animation.InsertKeyFrame(1, 60f / 90f, linearEasing);
            //animation.IterationBehavior = AnimationIterationBehavior.Forever;

            _properties = compositor.CreatePropertySet();
            _properties.InsertScalar("Progress", 30f / 90f);

            var progressAnimation = compositor.CreateExpressionAnimation("_.Progress");

            progressAnimation.SetReferenceParameter("_", _properties);
            visual.RootVisual.Properties.InsertScalar("Progress", 0.0F);
            visual.RootVisual.Properties.StartAnimation("Progress", progressAnimation);

            ActualThemeChanged += OnActualThemeChanged;
        }
示例#4
0
 public SettingsSearchEntry(string text, IAnimatedVisualSource2 icon)
 {
     Text = text;
     Icon = icon;
 }
示例#5
0
 public SettingsSearchFaq(string url, string text, IAnimatedVisualSource2 icon = null)
     : base(text, icon)
 {
     Url = url;
 }