Set Window Properties based on Datatype of UserControl
Posted
by Kage
on Stack Overflow
See other posts from Stack Overflow
or by Kage
Published on 2010-05-10T03:35:16Z
Indexed on
2010/05/10
3:38 UTC
Read the original article
Hit count: 317
I've got a simple window, that is container for various views. I've got a DataTemplate that shows the correct view based on whatever the window's MainViewModel property is set to.
<DataTemplate DataType="{x:Type VM:StartupViewModel}">
<AdornerDecorator>
<V:StartupView />
</AdornerDecorator>
</DataTemplate>
What I'd like to do is for certain views, change some properties on the base window, ie WindowStyle, ResizeMode etc. something like triggers, but on datatypes instead of property values? How could I accomplish this?
© Stack Overflow or respective owner