Simple Bind from SoftSource Consulting
Purchase | Overview | Support
Simple Bind from SoftSource Consulting provides a MVVM-style binding experience for Unity applications! Simple Bind lets Unity developers easily implement powerful binding functionality similar to WPF, AngularJS, and other MV* frameworks.
Key functionality includes:
- Property binding
- Event binding to Unity Events
- Inheritable BindingContext (data context)
- Editor for easy configuration of bindings
- Value Converters / Multi-Value Converters
- Built-in Value Converters (int to string, double to string, etc.)
- Built-in Multi-Value Converters (doubles to string, RGB to color)
- Data bound controls (Items Control, List Box, Tooltip)
- Easily create data bound Item Templates
Update: V0.2 has been released, introducing the following new features:
- Editor context menu integration allowing the creation of Simple Bind Controls directly from the context menu
- Command class allowing Execute/CanExecute functionality to be easily bound from the View Model to the View
- Command Button control that fully utilizes the Command class
- Simple Prefab Editor to simplify View editing
- Simple Bookmarks to switch quickly between Game Objects within the hierarchy
- Variety of defect fixes within the core binding classes
Compatible with Android and iOS.
https://www.youtube.com/watch?v=MX7qiR05HRA
https://www.youtube.com/watch?v=JA4hGmH9dQE
https://www.youtube.com/watch?v=wyRfSuz5oKQ
We had a great question come in this morning via the Simple Bind support e-mail unity@sftsrc.com and we wanted to create a short video to answer that question and provide another example of how Simple Bind can work within your Unity project.
To summarize the users question he asked:
“I want the user to be able to select a clickable spot on a 3D map which dynamically toggles a corresponding item in a list view and vice-versa. The notion of vice-versa is important to me and I would like to keep it really simple.
Do you think Simple Bind (as is v0.1) could help me to simply achieve that?”
The quick and simple answer to that is Yes. Simple Bind can be used for 3D, 2D and uGUI GameObjects and Components. Really, any GameObject can work with Simple Bind.
The more in depth answer lies in the existing architecture of your project. Simple Bind can help solve this problem by simply binding values between GameObjects or it could be used to facilitate a more loosely coupled MVVM architecture where the different pieces are backed by the same Model.
Since the user was asking for the simple answer that is what we will cover in this video located on our YouTube channel:
Thanks for the detailed explanation and dedicated video
And yes, you have indeed fully answered my question 
In term of architecture, not so sure yet if I will use a MV**, this is still under study, hence my interest in your package.
Of course I do have many questions which are driven by :
“it could be used to facilitate a more loosely coupled MVVM architecture where the different pieces are backed by the same Model”
Well…So… what is coming next? An approximate idea how and when V1.0 will be? More details about features in ListBoxControl? DataTemplate?
(I promise I will try to be patient=)
I am glad to hear that I was able to answer your question fully.
As to your other questions…
We have a very long and broad list of potential features that we would like to add to the Simple Bind package. However, we are trying to be careful about what we actually add to make sure that what is in the product is useful and easily integrated into any Unity project.
This is actually one of the main reasons that we decided to put out a V0.1. We wanted to release the core mechanic (data and event binding) and then get feedback from the community as to how they would want to utilize these mechanics. Your feedback will help us decided which items to pull off our backlog list to work on next 
We do not have an exact road-map yet, but I can say that V0.2 is coming along nicely.
Among the new/updated features will be:
- Command Binding / Command Button (similar to ICommand from WPF)
- Content Control with Data-Typed Template resolution
- Integration into the Unity Editor for easier access to Simple Bind Controls
- Better handling for generic UnitEvents
- Additional error and fallback handling
If you have specific use cases or features that you would like to see in Simple Bind please let us know. If they match with our goals we will bump them up in priority to get them to you faster.
There are also several more demo videos in the works that will cover the controls released in V0.1. Be watching this thread and we will let you know when they become available.
The next video in the Simple Bind series has been released and covers the basics of using the Simple Bind Tool Tip.
This is interesting because your system apparently greatly opens the possibility of new interaction scenarios.
But for now, I noticed your package because I’m looking for ways to achieve exactly what you demonstrate in its most basic form :
Connect 3D Objects with matching Ui items through a vice versa binding.
What can happen (and how your asset could help) if we have, let’s say, some decades of those?
I know you may answer that there are many ways to achieve that and it depends of the architecture.
I do agree so let’s start simple and reformulate the question:
Using Simple Bind, what would be the simplest way to :
Connect fifty 3D Objects with matching Ui items through a vice versa binding?
Tropobor, thanks for the great questions.
I spent a little bit of time today and put together a second video to answer your question about how to dynamically generate model information and then use that model information to provide two-way binding between 3D Objects and multiple uGUI items.
It is a bit longer than the other videos but I hope it will provide a lot more detail about how Simple Bind can be used in a data driven application.
In this demo we create 100 random Planets, display each planet as a 3D Object in World space using a Simple Bind Items Control and in the UI using a Simple Bind List Box.
We will also be using multiple binding mechanics, value converts and event binding.
Please let me know what new questions this video brings up 
Thank you. Your explanation is clear, organized, generous and generic.
Considering my angle regarding your asset, your video largely outweigh what I was going to ask next.
I really wish other designers submit their issues and suggest other forms of architectures that can be built with this.
Ahhh… as a fellow WPF convert, this is like taking my shoes and socks off after a long day of work and wiggling my toes in thick pile carpet. Seriously, I can’t think of any framework I’ve ever learned that had as large of a payoff as WPF has. Once you get past the learning escarpment, it is remarkable.
I just got the package last night, so I’m still feeling my way around and I don’t have my UI fully ready to take advantage of any more advanced features or event binding (though I can vouch I can bind text values - and I have a strong desire to throttle whoever came up with the UGUI layout engine).
Two thoughts immediately jump to mind. Have you ever used ReactiveUI for WPF? We use an older version (.NET 4.0 based, so like Unity it is pre-“await”) at work, and had good success. I have noticed there is a UniRX…
So, as I ask this with little knowledge of how you’ve implemented this yet: how does asynchronous updates affect the data binding? I notice that you are NOT relying on INotifyPropertyChanged, as you don’t require changes to the scripts to bind to them (one of the reasons why I chose Simple Bind over Data Binding for Unity - Data Binding for Unity appears heavily geared to UI elements with custom scripts for custom UI elements and special “Context” base classes, etc. ). This leads me to believe you’re creating a property accessor reference and comparing the values every update, which would run into locking issues in an asynchronous update.
Though two, I’m using “New UI Widgets” as well, and it has a list box that I’m looking to add the equivalent of a WPF ItemTemplateSelector to it. I notice you mentioned template resolution as an upcoming feature. Is there a good way of doing this now, or should I just hold off for now?
1 Like
PixelHero - Welcome to the Simple Bind forum and thanks for your purchase.
I have not used ReactiveUI for WPF but have used other Rx frameworks and looked into UniRx a bit. At this point there are no plans for Simple Bind to incorporate any async style bindings directly, but that does not mean we will not add them to the investigation backlog.
Our primary goal in creating Simple Bind was to make implementing binding as seamless as possible without the need to modify existing classes or scripts. You are exactly correct in your deduction that we are creating property references and checking the value during the LateUpdate method each frame. This method of updating the binding does come with some performance implications and is by far the most brute force. However, it was the best first step to accomplishing our goals and is needed to allow binding to existing Unity Components and third party assets.
One of the future steps for Simple Bind will be to integrate a check to determine if the Binding Context implements INotifyPropertyChanged. If it does then the Binding will subscribe to the PropertyChanged event and skip the LateUpdate check. This will improve performance and give the underlying context (ViewModel) the ability to control the update timing and mechanism if needed (such as async updates with deferred change notification). However, this also requires that the developer follows the INotifyPropertyChanged pattern in their classes. (If you look into the Simple Bind code you will notice that there are a few hooks already in place for this)
With the current binding mechanism async updates to one way bindings should not cause any issues (however, it has not been tested) since it is a read only operation and if the value updates on the background thread between the change check and the actual getting of the value then the latest value will always be used. The check also happens every frame so any miss in the change check will be caught on the next frame. However, asycn updates on a two way binding would potentially cause issues as there would be a possible race condition between both sides of the binding trying to update at the same time.
As for Template Selectors, there is not an easy way to accomplish this in V0.1. However, V0.2 does include a Content Control that allows basic Data Typed Template Selection. With the holidays the V0.2 release was delayed sightly, but we are putting the final touches on it now.
Please let me know if I have answered your questions and if you have any additional comments or concerns.
1 Like
Actually, yes, that was very informative, thank you!
My particular interest in the async comes from layering a view on a heavy multi-core simulation. This simulation core is “unity-free” and fits very nicely into an MV* paradigm. This approach has many advantages, and binding makes the interacting with the user interface elements that much easier. As of right now, I’ll probably have to rely on my Controller/ViewModel caching the async data.
Your proposed changes to allow the use of INotifyPropertyChanged, however, sounds ideal. Both for the performance and, as you mention, as a way I can avoid caching the data. I’m already receiving change notifications from my model, so I can merely delay them until the LateUpdate myself.
One other thing that you have probably mentioned somewhere, but you don’t have deep binding path walking, do you? (that is, to say a binding path (on a binding context) of Value.Inventory.Count? It appears to allow Value.Inventory just fine, and due to the direct access to the unity hierarchy, it seems like this is a non-issue. I can either manually walk down the path using nested binding Contexts or refer to a parent object’s binding context to walk up. I’m not surprised if you don’t support deep binding paths as it is difficult to get it right, and your implementation seems to have a convenient workaround to this issue. I just want to make sure I’m right here and not missing anything.
Thanks!
I am glad the information was helpful.
The current version (V0.1) does support full property path walking when bound to a Binding Context. For your example, Value.Inventory.Count, should work just fine. There is currently no depth limit on the property path.
Simple Bind does not currently support multi-level property paths when bound to Components other than the Binding Context. However, this feature is in the backlog.
Ah, yeah, that was my mistake. I was setting the top level binding context to my view model script, but I naively assumed that to get the script itself rather than a child property I should use a path of “None.” NOPE! Turns out that is truly none. I had to create a “Self” property in my script:
public T Self { get { return this; } }
That wasn’t obvious to me and I wouldn’t rule out that I missed something, but I wasn’t able to find another way to reference it. Works fine now, though!
PixelHero - could you please provide a little more information about how your binding, view model and hierarchy is setup?
It should be possible to get the bound object directly without the need to create a “Self” property.
Sure!
I’ll go into more detail than I think you are asking for to benefit anyone who follows along later.
I have MVC setup for the existing items. That is-
- Model - a Unity independent Model that is used at the simulation level. It largely consists of data.
- Controller - a Controller that knows about both the Model and the View. It knows to, say, play an animation due to data that occurred in the Model. Or it knows to alter the Model’s health value because it detected a collision with a projectile.
- View - That is the actual representation of the Model in the gameworld. It might be a 3d model, it might be a 2d image. In unity, this is your actual gameobject.
For the purposes of what follows, lets refer to an instance of one of these as an Entity.
That is all existing in the game. Then I added a UI for an Entity that uses binding. It consists of:
- A View - This is the actual user interface components. Contains bindings on the viewmodel.
- a ViewModel - this is used as the datacontext for the View, but it does not actually know how the view is constructed. Contains references to the Controller for data access. Note that the ViewModel doesn’t duplicate data, but it does serve as a place to do things like string manipulations, View/ViewModel-only properties and behavior, and respond to user interface interactions to change things in the Entity.
In my case, my UI contains a “pin” functionality that prevents the window from closing when opening the UI for another Entity. This is useful in debugging, as you can expose AI behaviors and show them change in response to environmental state.
However, that’s a UI View/ViewModel only property. It makes no sense to stuff that in the MVC Entity. So for that Binding, I was binding to a property on the ViewModel, but for other data, I either need to create pass-through properties in my ViewModel to the controller/Model data, or I need to bind into the controller.
The one I was having trouble with, however, was the “pin” functionality. My viewModel has
bool Track {get;set;}
And setting the UI binding context to the ViewModel, I had to use a “self” property in my viewModel in the binding context to allow a bind later to the BindingContext’s Value.Track to succeed.
Thanks for the detailed information.
I am going to set up a sample project to mimic the behavior that you are looking in order to verify that this works correctly (without the need for the Self property) in the upcoming release.
Here’s a simple test scene with four test cases in a scene in the root assets folder… I have a simple canvas with a child text object. In the first two cases (which appear on top) have the text box binding to the parent’s context, which is set to be the VM script with a path of either “None” (In WPF, this would be the item itself when passing parameters to templated children, etc) or “Self” - a property I gave the VM just so the binding would have something to grab.
The second two use inheritance.
I don’t see any way to set the datacontext to the VM, other than to use a Self property. Not a problem, really, but this shows what I was trying to do (and if there is some obvious thing I’m missing).
Hope it helps!
Note: you must import simplebind v0.1 before loading the scene in the root asset folder.
2463226–169610–simpleBind Self.unitypackage (7.96 KB)
Thanks for submitting the test project, it looks similar to the test project I had set up.
I ran some tests comparing V0.1 with the latest code that will come out in V0.2 and this issue appears to be resolved.
When viewing the Binding Context while in Play Mode you should see the correct Value displayed in the inspector.
Using V0.2 I get the following in Play Mode:

As you can see when the Path is set to None then the Value is set to the instance of the Component.
In V0.1 this same test will show a Value of Null.
I appreciate you posting the test project, but please do not include the SimpleBind asset directly when posting to the forum as this is basically giving away the asset to everyone on the forum. If you could please remove the package from your last post and replace it with a package that only has the test code without the SimpleBind asset it would be greatly appreciated.
Thanks
Ah! Whoops! I posted that late at about 3am local time (first night my kid was in a toddler bed), and I was pretty sure I needed to include it since you’d be running a different version. Yeah, I should have thought that through a little more.
I just removed it for now, I’ll upload another one as you suggested later tonight. Sorry! That wasn’t my intent.
No worries. Thanks for updating your post.