public ColorPalette(IBrush primary,
                            IBrush primaryVariant,
                            IBrush secondary,
                            IBrush secondaryVariant,
                            IBrush background,
                            IBrush surface,
                            IBrush error,

                            IBrush onPrimary,
                            IBrush onSecondary,
                            IBrush onBackground,
                            IBrush onSurface,
                            IBrush onError)
        {
            _cachedAlphas = new DoubleConcurrentDictionary <ColorType, Double, IBrush>();

            Primary          = primary;
            PrimaryVariant   = primaryVariant;
            Secondary        = secondary;
            SecondaryVariant = secondaryVariant;
            Background       = background;
            OnSecondary      = onSecondary;
            OnBackground     = onBackground;
            Surface          = surface;
            Error            = error;
            OnSurface        = onSurface;
            OnError          = onError;
            OnPrimary        = onPrimary;
        }
Ejemplo n.º 2
0
        public VisualStyleProvider(IStyleInflater styleInflater,
                                   IDictionary <Type, IEnumerable <IStyleRule> > visualTypeRules)
        {
            _styleInflater        = styleInflater;
            _cachedTypeStyleRules = new ConcurrentDictionary <Type, HashSet <IStyleRule> >();
            _visualTypeRules      = new ConcurrentDictionary <Type, List <IStyleRule> >();
            _cookedTypeStyles     = new ConcurrentDictionary <Type, IStyleSheet>();

            foreach (var kvpp in visualTypeRules)
            {
                _visualTypeRules[kvpp.Key] = new List <IStyleRule>(kvpp.Value);
            }

            //_themeProvider = themeProvider;

            _lockStylesByClassName = new Object();
            _stylesByClassName     = new Dictionary <String, HashSet <IStyleRule> >();

            _lockStylesByName = new Object();
            _stylesByName     = new Dictionary <String, IStyleSheet?>();

            _resourcesLock = new Object();
            _resourcesRead = new HashSet <String>();

            _typeClassStyles = new DoubleConcurrentDictionary <Type, String, IStyleSheet>();
            //_typeStyleStyles = new DoubleConcurrentDictionary<Type, String, IStyleSheet>();
        }
 public BindingBuilder(ITypeInferrer typeInferrer,
                       IPropertyProvider propertyProvider,
                       IAssemblyList assemblies,
                       IResourceBuilder resourceBuilder)
 {
     _typeInferrer            = typeInferrer;
     _propertyProvider        = propertyProvider;
     _assemblies              = assemblies;
     _resourceBuilder         = resourceBuilder;
     _cachedPropertyAccessors = new DoubleConcurrentDictionary <Type, String, IPropertyAccessor>();
 }
 public AppliedStyle(IStyleSheet styleTemplate)
 {
     StyleTemplate        = styleTemplate;
     _appliedRules        = new List <AppliedStyleRule>();
     _monitoredProperties = new DoubleConcurrentDictionary <IVisualElement, IDependencyProperty, Byte>();
 }