Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 private static void OnOrientationChanged(ViewModel model, DependencyPropertyChangedEventArgs e)
 {
     model.OnOrientationChanged();
 }