private void LoadProperties(FrameworkElement element, bool styleMode) {
if (styleMode) {
CustomShape = false;
StyleColorsNumber = 3;
} else {
ShapeColorsNumber = 3;
}
var properties = element.Tag as string;
if (properties == null) return;
foreach (var s in properties.Split(';')) {
var pair = s.Split(new[] { '=', ':' }, 2);
if (pair.Length != 2) continue;
var key = pair[0].ToLowerInvariant();
if (styleMode) {
switch (key) {
case "customshape":
CustomShape = string.Equals(pair[1], @"true", StringComparison.OrdinalIgnoreCase);
break;
}
}
switch (key) {
case "colors":
if (styleMode) {
StyleColorsNumber = FlexibleParser.ParseInt(pair[1], 3);
} else {
ShapeColorsNumber = FlexibleParser.ParseInt(pair[1], 3);
}
break;
}
}
}