Reputation: 12832
I'm trying to get a Window's datacontext to be set to itself, but I can't figure out what the syntax should be.
<Window x:Class=" ...
DataContext="{Binding Self}"
Doesn't seem to work.
Any ideas?
Thanks!
Upvotes: 4
Views: 243
Reputation: 50038
What about
<Window DataContext="{Binding}".../>
I cant see the purpose of your requirement. If you are setting the Window.DataContext from any part of your application you really doesn't need another binding. Your DataContext must have already set with out a binding expression.
Upvotes: -1
Reputation: 101585
<Window DataContext="{Binding RelativeSource={RelativeSource Self}}">
Upvotes: 6