View difference between Paste ID: 79qpcvPX and 14M5H84P
SHOW: | | - or go back to the newest paste.
1-
		private void Bind()
1+
private void Bind()
2-
	{
2+
{
3-
		if (Related == null)
3+
    if (Related == null)
4-
			return;
4+
        return;
5-
		
5+
    
6-
    	// Для каждого визуального контрола поищем метод, с которым его надо связать
6+
    // Для каждого визуального контрола поищем метод, с которым его надо связать
7-
		for (int i = 0; i < BindingBehavior.Count; i++)
7+
    for (int i = 0; i < BindingBehavior.Count; i++)
8-
		{
8+
    {
9-
			BindingEvent eventContainer = null;
9+
        BindingEvent eventContainer = null;
10-
			var behaviorName = BindingBehavior[i].Name;
10+
        var behaviorName = BindingBehavior[i].Name;
11-
			
11+
        
12-
			if (!IsDoneBinding(behaviorName))
12+
        if (!IsDoneBinding(behaviorName))
13-
			{
13+
        {
14-
				eventContainer = Related.GetBindingEvent(behaviorName);
14+
            eventContainer = Related.GetBindingEvent(behaviorName);
15-
				AddDoneBinding(behaviorName);
15+
            AddDoneBinding(behaviorName);
16-
			}
16+
        }
17-
			
17+
        
18-
			if (eventContainer != null)
18+
        if (eventContainer != null)
19-
			{
19+
        {
20-
				BindEvent(BindingBehavior[i], eventContainer);
20+
            BindEvent(BindingBehavior[i], eventContainer);
21-
			}
21+
        }
22-
		}
22+
    }
23-
		
23+
    
24-
		// Для каждого метода, поищем визуальный контрол, который не знает как себя вести
24+
    // Для каждого метода, поищем визуальный контрол, который не знает как себя вести
25-
		for (int i = 0; i < BindingEvent.Count; i++)
25+
    for (int i = 0; i < BindingEvent.Count; i++)
26-
		{
26+
    {
27-
			var eventName = BindingEvent[i].Name;
27+
        var eventName = BindingEvent[i].Name;
28-
			if (IsDoneBinding(eventName))
28+
        if (IsDoneBinding(eventName))
29-
				continue;
29+
            continue;
30-
			
30+
        
31-
			BindingBehavior behaviorContainer;
31+
        BindingBehavior behaviorContainer;
32-
			behaviorContainer = Related.GetBindingBehavior(eventName);
32+
        behaviorContainer = Related.GetBindingBehavior(eventName);
33-
			
33+
        
34-
			if (behaviorContainer != null)
34+
        if (behaviorContainer != null)
35-
			{
35+
        {
36-
				BindEvent(behaviorContainer, BindingEvent[i]);
36+
            BindEvent(behaviorContainer, BindingEvent[i]);
37-
				AddDoneBinding(eventName);
37+
            AddDoneBinding(eventName);
38-
			}
38+
        }
39-
		}
39+
    }
40-
	}
40+
}