private void BindInterests(ViewInterest vi) { var bc = FindBindingContext(vi.View); foreach (var interest in vi.Interests) { interest.BindingContext = bc; } }
/// <summary> /// Utility function to locate a specific interest /// </summary> /// <param name="view">The view that has the interest</param> /// <param name="interestedin">The collection of <see cref="GestureInterest"/></param> /// <returns>A <see cref="ViewInterest"/></returns> internal void RegisterInterests(View view,IEnumerable<GestureInterest>interestedin ) { var vi = _viewInterests.FirstOrDefault(x => x.View == view); if (vi == null) { vi = new ViewInterest { View = view }; _viewInterests.Add(vi); } vi.Interests=new List<GestureInterest>(interestedin.ToList()); BindInterests(vi); }
/// <summary> /// Utility function to locate a specific interest /// </summary> /// <param name="view">The view that has the interest</param> /// <param name="interestedin">The collection of <see cref="GestureInterest"/></param> /// <returns>A <see cref="ViewInterest"/></returns> internal void RegisterInterests(View view, IEnumerable <GestureInterest> interestedin) { var vi = _viewInterests.FirstOrDefault(x => x.View == view); if (vi == null) { vi = new ViewInterest { View = view }; _viewInterests.Add(vi); } vi.Interests = new List <GestureInterest>(interestedin.ToList()); BindInterests(vi); }
private void BindInterests(ViewInterest vi) { var bc = FindBindingContext(vi.View); foreach (var interest in vi.Interests) { if (interest.BindingContext == null) interest.BindingContext = bc; } }