Performance Impact Wpf Binding Path = {x: Static <pathpath>}?

I have a CLR instance property, the static PropertyPath property, which points to the instance property and the xaml binding, which uses the static PropertyPath just like this:

NB: GetPropertyPath is just a method that returns a property path based on a given linq expression on behalf of a member.

<Preview> <Code> public static PropertyPath MyPropertyPath = GetPropertyPath (p => p.MyProperty); private object _myProperty; public object MyProperty {get {return _myProperty;} set {_myProperty = value; OnPropertyChanged (MyPropertyPath.Path); }} Code>

Then, with MyViewModel as a datacontext in the standard mvvm module, the xaml binding is set as:

<Preview> <Code> {Binding Path = {x: static space myNamespace: MyViewModel.MyPropertyPath}} Code>

This approach has a big advantage because the code does not use links that are not checked as part of the assembly. If something has changed in the viewmodel code, xaml binding error during assembly if they are no longer correct.

My question is, does anyone know of any negative impacts that might affect this approach?

+2
source share
2 answers

. OnPropertyChanged(string propertyName) OnPropertyChanged(Expression<Func<object>> expression)? GetPropertyPath(), ~ 2,5 , (569 1464 1 000 000 ). , Expressions .

- . - - ...

0

, GetPropertyPath() , , , 'OnPropertyChanged ( > )' .

, , , x: Static xaml, ? , x: static?

0

All Articles