XnaBind provides a simple way to perform property data binding in Xna Games.
With XnaBind you can create a dynamic link between two object properties and let the update themselves automatically.
The project was created to help Xna game developers write less code and create more features, but it can be used on any .Net 3.5+ project.
Example of Bind
Here is the most simple example of a Bind of two properties of the same type:
//Declare two sprite objects
Sprite sprite1 = new Sprite();
Sprite sprite2= new Sprite();
//Create a Bind
Bind<float> bind = new Bind<float>(sprite1.X, sprite2.X, BindDirection.OneWay);
Now these two properties are linked and every time
sprite1.X is changed its value will be set on
sprite2.X.
In this case the two sprites will have the same position on the X axis.
Learn XnaBind
To know how to use XnaBind read the
Tutorials pages.
There are a lot of stuff to learn like how
Lambda Expressions improves your bind operations.
The
Samples page has some project examples of utilization of XnaBind in Xna games.
Do you have an idea for samples? Please send me and I will publish it with the credits.
See the
Documentation page to get more details about XnaBind implementation and requirements for its utilization.