Created
May 4, 2011 14:44
-
-
Save ahjohannessen/955334 to your computer and use it in GitHub Desktop.
Temporary impl of binding provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Temporary : Needs discussion + test coverage (if used) | |
public class FubuBindingProvider : BindingProvider | |
{ | |
private readonly ISparkItems _sparkItems; | |
public FubuBindingProvider (ISparkItems sparkItems) | |
{ | |
_sparkItems = sparkItems; | |
} | |
public override IEnumerable<Binding> GetBindings (IViewFolder viewFolder) | |
{ | |
var bindings = new List<Binding> (); | |
foreach (var binding in _sparkItems.ByName("bindings")) { | |
var file = viewFolder.GetViewSource (binding.ViewPath); | |
using (var stream = file.OpenViewStream()) | |
using (var reader = new StreamReader(stream)) { | |
bindings.AddRange (LoadStandardMarkup (reader)); | |
} | |
} | |
return bindings; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment