Hi,
Based on my understanding of your code snippet, it seems that you are trying to set the Style for the views by setting it as a Window Resource. Nevertheless, this won't work because the Width and Height properties are binding to the Window DataContext, and not to the one of the View inside it. Therefore, in order to follow this approach you need to target the binding against the content of the Window using a relative path.
On the other hand, another simpler approach you could try is to set the Window to adapt itself to its content's size and then set the Height and Width of the view only, instead of the Window. To do this, you can:
Hope this helps,
Federico Martinez
http://blogs.southworks.net/fmartinez
Based on my understanding of your code snippet, it seems that you are trying to set the Style for the views by setting it as a Window Resource. Nevertheless, this won't work because the Width and Height properties are binding to the Window DataContext, and not to the one of the View inside it. Therefore, in order to follow this approach you need to target the binding against the content of the Window using a relative path.
On the other hand, another simpler approach you could try is to set the Window to adapt itself to its content's size and then set the Height and Width of the view only, instead of the Window. To do this, you can:
-
Replace the properties width and height from your Window style for this setter property:
<SetterProperty="SizeToContent"Value="WidthAndHeight"/>
-
Set the Height and Width of the view
Hope this helps,
Federico Martinez
http://blogs.southworks.net/fmartinez