CompositionPropertySet EnsureThemeProperties(Compositor compositor)
 {
     if (_themeProperties is null)
     {
         _themeProperties = compositor.CreatePropertySet();
         _themeProperties.InsertVector4("Background", ColorAsVector4(Background));
         _themeProperties.InsertVector4("Foreground", ColorAsVector4(Foreground));
         _themeProperties.InsertScalar("StrokeWidth", StrokeWidth);
     }
     return(_themeProperties);
 }
Пример #2
0
 public static void InsertValue <T>(CompositionPropertySet prop, string name, T value) where T : struct
 {
     { if (value is float v)
       {
           prop.InsertScalar(name, v);
       }
     }
     { if (value is Vector2 v)
       {
           prop.InsertVector2(name, v);
       }
     }
     { if (value is Vector3 v)
       {
           prop.InsertVector3(name, v);
       }
     }
     { if (value is Vector4 v)
       {
           prop.InsertVector4(name, v);
       }
     }
     { if (value is Quaternion v)
       {
           prop.InsertQuaternion(name, v);
       }
     }
 }
Пример #3
0
        CompositionPropertySet EnsureThemeProperties(Compositor compositor)
        {
            if (_themeProperties == null)
            {
                _themeProperties = compositor.CreatePropertySet();
                _themeProperties.InsertVector4("Foreground", ColorAsVector4(_themeForeground));
            }

            return(_themeProperties);
        }
Пример #4
0
 public static CompositionPropertySet SetValue(this CompositionPropertySet set, string name, Vector4 value)
 {
     set.InsertVector4(name, value);
     return set;
 }