/// <summary> /// Sets the styles this list displays. /// </summary> /// <param name="styles">The styles.</param> /// <param name="resourceManager">The resource manager.</param> public void SetStyles([NotNull] IEnumerable <TileStyle> styles, [NotNull] GDIResourceManager resourceManager) { Controls.Clear(); foreach (TileStyle style in styles) { StyleControl styleControl = new StyleControl(style.Style, resourceManager); styleControl.StyleChanged += (sender, args) => { if (styleControl.Style == null) { return; } style.Style = styleControl.Style; StylesChanged?.Invoke(sender, args); }; AddStyle(styleControl); } }
/// <summary> /// Signals that the styles have been updated. /// </summary> public void Refresh() { StylesChanged?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Invoke StylesChanged event /// </summary> /// <param name="styles">New app styles</param> internal static void Call_StylesChanged(Styles styles) { StylesChanged?.Invoke(styles); }
/// <summary> /// Raises the <see cref="E:Changed" /> event. /// </summary> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected virtual void OnChanged(EventArgs e) { StylesChanged?.Invoke(this, e); }