wpf - SortDescription with custom attached property -


In XML, I can set a custom attachment using Local: TestClass.TestProperty = "1"

{binding path = (namespace: [owner type]. [Property name])} {binding path = (local: testclass.TestProperty)}

but how can I specify when Need to use custom attached property in a SortDescription, then namespace? I can share an affiliate property using new sort dashtion ("(grid .row)", list separation. Descending, but here I can not set a namespace anywhere ...

Best Relationship, Jasper

You can not do this for a single reason, because {binding Path = a: bc} works but {binding a: bc} no: no name near property path constructor Thanh reference no.

Unfortunately, in case of sort of decryption you can not do much about it. You have to find a way to sort without using the attached properties.

Normally I tell people that the use of tags is an indication of bad coding, but in this case tag can be your best option: you have an object inside a tag, which is the properties , Which returns the actual enclosed properties back to you.

Changed callbacks to your property, for an example of an internal class, tag immediately:

  public class test class: DependencyObject {... TestProperty announcement ... PropertyChangedCallback = (Obj, e) = & gt; {... if (obj.Tag == faucet) obj.Tag = new PropertyProxy {container = obj}; }); Public Class Property Proxy (Dependency Object Container; Public SomeType TestProperty {get GetTestProperty}}}}}}  

You can now use the sub-property of the tag in your sort order :

  SortDescription property name = "tag. Testproperty" />  

If there is only one attribute to sort, then you You can use the tag for this.

The main problem with this is that using the tag property Conflicts with any other code that also tries to use the tag, you can see some vague dependency properties in standard libraries that do not apply to the object in question, and use it instead of tags.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -