private static void onSymbolChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { (o as PredefinedLineStyle).ControlTemplate = ResourceData.Dictionary[string.Format(CultureInfo.InvariantCulture, "PredefinedLineStyle_{0}", e.NewValue)] as ControlTemplate; } }