예제 #1
0
파일: Common.cs 프로젝트: sizzles/framework
        private static void InititializeRoute(FrameworkElement fe, string route, DependencyProperty property)
        {
            PropertyRoute parentContext = GetPropertyRoute(fe.Parent ?? fe);

            if (parentContext == null)
            {
                throw new InvalidOperationException("Route attached property can not be set with null PropertyRoute: '{0}'".FormatWith(route));
            }

            var context = ContinueRouteExtension.Continue(parentContext, route);

            if (property == Common.RouteProperty)
            {
                SetPropertyRoute(fe, context);

                foreach (var task in RouteTask.GetInvocationListTyped())
                {
                    task(fe, route, context);
                }
            }
            else
            {
                foreach (var task in LabelOnlyRouteTask.GetInvocationListTyped())
                {
                    task(fe, route, context);
                }
            }
        }