Designtime changed values (by code)

Hello,

I have an other problem with the dependency Properties.
I have a custom Designer for some of my custom activities. On DoubleClicking the Avtivitiy a form is shown with wome different inputs for the user.
On Closing the form the entered values will be saved in the Properties of the activities.

The Problem is first time i change the values everything works correct. But if i try to change the values after reloading the workflow, they don`t change their values anymore. It only works if i type the values directly into the Property Grid.

Example of saving the values in the form:

private void btnOK_Click(object sender, EventArgs e)
{
//Save string with placeholders
this.activity.Message = inputText.Text;

//Close the editor form
this.Close();
}

Example of the Dependency Property in the custom activity:

[Description("Text with Placeholders to replace.")]
[Category("Data")]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string Message
{
get
{
return ((string)(base.GetValue(StringBuilder.MessageProperty)));
}
set
{
base.SetValue(StringBuilder.MessageProperty, value);
}
}

Does anyone know where the problem is Is this a bug of the Windows Workflow foundation

An other problem is that the values in the property grid won' t update after changing them with the the form. Is there a workaround to refresh the property grid


Thanks for reply!

speed2002


Answer this question

Designtime changed values (by code)

  • Ed Mee

    I put together a sample to show to do this and posted on my blog.

  • Shekar A

    Thanks a lot!

    It works perfekt. Exactly what i was looking for! ;)

    Greetz speed2002

  • Designtime changed values (by code)