protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); textBoxEditor.Text = DynamicDelegateGenerator <TDelegate> .GenerateCode(); listBoxReferences.ItemsSource = DynamicDelegateGenerator <TDelegate> .GetDefaultReferenceAssemblies(); }
private void ButtonCreate_Click(object sender, RoutedEventArgs e) { try { var del = DynamicDelegateGenerator <TDelegate> .CreateDelegateFromSource(textBoxEditor.Text); SetValue(DelegateDependencyPropertyKey, del); } catch (Exception exception) { textBoxError.Text = exception.Message; SetValue(DelegateDependencyPropertyKey, null); } }