Exemple #1
0
 private static ResourceDictionary GetAccentResource(Accent accent)
 {
     return(accent.Specified != null
                         ? new ResourceDictionary {
         Source = CreateAccentResourceUri(accent.Specified.Value),
     }
                         : GetAccentResource(accent.Color ?? WindowsTheme.GetAccentColor()));
 }
        public void Attach(IChromeOwner window)
        {
            Action <Color> applyAccent = color =>
                                         this.Background = new SolidColorBrush(Color.FromRgb(color.R, color.G, color.B));

            var disposable = WindowsTheme.RegisterAccentColorListener(applyAccent);

            this.Closed += (sender, e) => disposable.Dispose();
            applyAccent(WindowsTheme.GetAccentColor());

            this.Attach(window, true);
        }