I did not try to do this with WPF, but with Windows Forms it works as you expected, so this might help:
I use media queries in lines:
@media (min-width: 300px) {
and I have a WebKitBrowser
control that is populated with a panel (since I have some controls attached to the top of my form) and can be confirmed by simply setting the dimensions of the form, for example.
this.MaximumSize = this.MinimumSize = this.Size = new Size(width, height);
launches media queries as I expected. For instance. I have a Portrait / Landscape button that I use, it just flips the width and height of the form, and the docked browser fills this new orientation. Should be pretty simple?
I think if you try it and then it does not work, you can provide a bit more information that / does not work.
source share