Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Unchangeable Dependency Property That Supports Binding

$
0
0

Hi guys,

I need to have an dependency property on my control which holds an action and that dependency property may not be changed but I may set binding on it, no matter if onewaytosource or twoway, the value of property which is a specific ation and may not be change or better said the property itself shall only give the action to source/viewmodel but the value of the property may never be change.

that is how i wish to pass an action<t>() value from control to viewmodel

one more time like i said the dependency property of my control may not be change no matter what

as example the property shall be so unchangeable that even when I set the binding manually in code binding in the middle of runtime nothing shall happen. the property shall not be changed.

my guess was to listen to onpropertychanged callback but i seem no to understand that well so i kept overriding the binding with the local value inside onpropertychanged method and then i wasnt able to pass the action to viewmodel.

to sum up.. the property value may not be change but value shall be passed through binding to viewmodel no matter if user sets binding mode to twoway or onewaytosource.

please no work arround by creating some attached property that shall observer or whatever :)

any ideas guy how to solve this, how to keep a dependency property unchangeable but setting binding on it shall still work?






Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>