index > Windows Workflow Foundation > Misunderstanding about Binding

Misunderstanding about Binding

hi,

I'm trying to bind the Message property of a MessageBoxActivity to the text property of a custom activty.

in messageboxActivity:

public static DependencyProperty MessageProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Message", typeof(string), typeof(MessageActivity));

private string message;

public string Message
{
get { return message; }
set { message = value; }
}

in custom activity:

public static DependencyProperty TextProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Text", typeof(string), typeof(Activity1));


private string _text;

public string Text
{
get { return _text; }
set { _text = value; }
}


but when I bind message to text, the messagebox is empty, whereas i've filled the Text property before compiling and when I use it in conditions or in a code activity, the Text property got the right value

Any idea in this really basic issu?

Antoine
AntoineF
Your properties are declared incorrectly. The .NET properties should be implemented in terms of the corresponding dependency property, like this:

public static DependencyProperty MessageProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Message", typeof(string), typeof(MessageActivity));

public string Message
{
get { return (string)base.GetValue(MessageProperty); }
set { base.SetValue(MessageProperty, value); }
}
Tomas Restrepo
ok that was the mistake!

thx a lot

ps: just don't forget to add the RETURN in the get for those who will take this code

Edit: Ok it's fixed ;)


AntoineF
Duh, yeah, fixed it :) That happens for writing code directly into the post :)



Tomas Restrepo [MVP]
Tomas Restrepo
reply 4

You can use google to search for other answers

 

More Articles

• Raising Events from the Service in the Workflow Runtime
• Workflow Activities for MSBuild Tasks and embedded designer for V...
• How to Cancel current waiting activity
• Rehydration and member variables
• MCMS Project Templates
• Communication between Workflow Instances without Runtime Service
• Custom Service loading from a different client request
• Problem when serializing an array property
• Is WF the right solution for InfoPath/WSS, when BizTalk is in pla...
• Modifying instance members from the host
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Tracking workflows dynamically loaded fr
• API Documentation RC2?
• Using activitiy menu in a embedded workf
• How to convert .dll back to .xoml?
• How to get an ActivityExecutionContext i
• looking for web editor for business proc
• Relationship to BPMN or BPEL?
• What' the difference between EventDriven
• Inter-activity communication?
• Error occurred while Loading Workflow
• Can you get the current state of a State
• in rule condition editor how to input ch
• Custom args class in event from custom a
• Cannot access a disposed object.Object n
• Correlation with nested custom activities

Hot Articles

• The underlying connection was closed: An
• Modifyable code in Custom Activity
• Event cannot be delivered
• Activites in different process
• Sheduling API Feature Request
• Rule reference Activity properties in XO
• Binding in XOML only workflows?
• parallelif
• Problem in ASP.NET's Global.asax with Ju
• Policy rules execution results
• Workflow Labs - files missing?
• Activity Position in Workflow
• workflow compiler with RuleconditionRefe
• Visual Studio hangs after WWF 1.2 is ins
• Newbie question - Methods not available

Recommend Articles

• Using workflows with asp.net Wizard
• How do I keep the parent alive?
• Working with parameters in workflow
• Windows workflow foundation and FileNet
• Moving unstructured pieces of "work
• Problem adding a SetState Activity in a
• Unit Testing with Team Foundation
• Designer problem, VS extensions
• re: Getting Here
• sqltracking and sqlpersistenceservice
• How do you pass data from an html web fo
• ASP.NET And a State Machine Workflow
• Some questions
• Passing parameters into the workflow.
• loading instance from persistence store