private void BindNavigationParameters(ViewModel model) { var injectors = model.GetType(). GetProperties(). Select(x => new {Property = x, Attribute = (NavigationParamAttribute) x.GetCustomAttributes(typeof (NavigationParamAttribute), false).FirstOrDefault()}). Where(x => x.Attribute != null); foreach (var injector in injectors) { var propertyValue = GetParameter(injector.Property.PropertyType, injector.Attribute); injector.Property.SetValue(model, propertyValue, null); } }
private static void OnOrientationChanged(ViewModel model, DependencyPropertyChangedEventArgs e) { model.OnOrientationChanged(); }