Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Nick Thissen
on
Not directly, but you can run a script when you select an item in the dropdown. In the script you can get the selected item in the dropdown (from which you derive your color somehow), and then apply it to your Widgets like this:

using System;
using System.Windows.Media;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;

namespace Scripts
{
public class ChangeColor : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
var colorValue = "#FF0000";
var color = (Color)ColorConverter.ConvertFromString(colorValue);

var widget = item.Theme.Widgets.Find("Widget1");
widget.Background.BackgroundColor = color;

return null;
}
}
}