Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Bind()
- {
- // Для каждого визуального контрола поищем метод, с которым его надо связать
- for (int i = 0; i < BindingBehavior.Count; i++)
- {
- BindingEvent eventContainer = null;
- var behaviorName = BindingBehavior[i].Name;
- if (Related != null && !IsDoneBinding(behaviorName))
- {
- eventContainer = Related.GetBindingEvent(behaviorName);
- AddDoneBinding(behaviorName);
- }
- if (eventContainer != null)
- {
- BindEvent(BindingBehavior[i], eventContainer);
- }
- }
- if (Related == null)
- return;
- // Для каждого метода, поищем визуальный контрол, который не знает как себя вести
- for (int i = 0; i < BindingEvent.Count; i++)
- {
- var eventName = BindingEvent[i].Name;
- if (IsDoneBinding(eventName))
- continue;
- BindingBehavior behaviorContainer;
- behaviorContainer = Related.GetBindingBehavior(eventName);
- if (behaviorContainer != null)
- {
- BindEvent(behaviorContainer, BindingEvent[i]);
- AddDoneBinding(eventName);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement