praeclarum / bind Goto Github PK
View Code? Open in Web Editor NEWA small but powerful C# library for data binding
License: Other
A small but powerful C# library for data binding
License: Other
Can we get a NuGet package of this? Thanks!
Within Bind.cs, around line 100, I would propose to check for read-only property using CanWrite:
} else if (p != null) {
if(p.CanWrite) {
p.SetValue(target, value, null);
}
Object reference not set to an instance of an object. Android not supported?
I have a change proposal for
public static object EvalExpression (Expression expr)
Instead of:
return lambda.Compile ().DynamicInvoke ();
you could do this:
var deleg = lambda.Compile ();
try {
return deleg.DynamicInvoke ();
}
catch (Exception ex) {
return null;
}
This prevents the application from crashing whenever the expressen called via DynamicInvoke throws an exception. Any contraindication?
Otherwise, bindings don't work
Solution : comment line
((v is IComparable) && ((IComparable)v).CompareTo(Value) != 0))
in method
void OnSideChanged(Expression expr, Expression dependentExpr, int causeChangeId)
Solution :
Add to RemoveMemberChangeAction method this line objectSubs.Remove(key);
` internal static void RemoveMemberChangeAction(MemberChangeAction sub)
{
var key = Tuple.Create(sub.Target, sub.Member);
MemberActions subs;
if (objectSubs.TryGetValue(key, out subs))
{
// Debug.WriteLine ("REMOVE CHANGE ACTION " + sub.Target + " " + sub.Member);
subs.RemoveAction(sub);
objectSubs.Remove(key);
}
}`
@praeclarum Any plans on continuing the development on this? would this work as-in in a Xamarin.Android (non-forms) implementation?
Awesome Frank! Have you tried this with a basic WinForm/WPF app? I may be an idiot and fresh off vacation but doesn't seem to be working as I change values in the textboxes...
I think there should really be value converters in here. Besides classic IValueConverter there could be simply a pair of Func<TIn,TOut> being passed to binding method.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.