Modify Window Chrome via templates?

I've been playing around with Avalon for quite some time. I love it and am really looking forward to what people can create with it.

My only gripe is the fact that the Avalon application resides inside a regular window chrome. Now, I understand why this was done, but does anyone else see a need to allow for customization of the window chrome

Could anyone explain to me how Microsoft Max accomplished this

Finally, I've opened up a suggestion on MSDN Product Feedback. If you think that customization of the window chrome should be allowed without Win32 calls, vote on it! http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx feedbackid=15245767-ffc2-4dc3-a34a-0a8337901bc5 Smile



Answer this question

Modify Window Chrome via templates?

  • Sguillo

    Two problems with that:

    1) There is still a faint border around it (Win XP)

    2) The window is still rectangular. I want to be able to define the window as a Elipse and everything outside the Elipse is transparent. You can't do that currently without resorting to Win32 (locks you into platforms).   


  • JMiguel

    A Media Player type application, any application that wants to allow minimization to a potentially semi-transparent area of the window space. We have been thinking about biting the bullet and making the p-invoke calls, but then again we don't want to override it 100% on Vista machines as glass looks damned cool. If we could set the background style of a window to be transparent as well, then it would be a relatively simple task to replicate the "Glass Effect" on any supported WinFX machine...would there ever be any chance in either

     Lauren Lavoie wrote:

    1) I agree that the border is not attractive - I believe it is something that we can remove by modifying Window's theme and I will work with my team on that. Thanks for the feedback.

    2) You are correct that non-rectangular windows requires a p-invoke to User32 today. Again, this is good feedback for the WPF team and I will pass it along to investigate whether it is something we can provide better support for in the platform.

    I'd be interested in knowing more about your scenario for creating non-rectangular windows. What type of app are you writing Feel free to respond to me directly if you'd like.

    Thanks,
    Lauren


  • danny_ward

    1) I agree that the border is not attractive - I believe it is something that we can remove by modifying Window's theme and I will work with my team on that. Thanks for the feedback.

    2) You are correct that non-rectangular windows requires a p-invoke to User32 today. Again, this is good feedback for the WPF team and I will pass it along to investigate whether it is something we can provide better support for in the platform.

    I'd be interested in knowing more about your scenario for creating non-rectangular windows. What type of app are you writing Feel free to respond to me directly if you'd like.

    Thanks,
    Lauren



  • Ed Maia MSFT

    I know I'm breaking some of the cardinal rules of Internet forums, but I just wanted to post another example of how managed access to the entire window hosting the WPF is needed:

    http://www.mperfect.net/backRow/

    the problem is that WPF will not let you effect the opacity of the Window. to do this you need to revert to pInvoking some Win32 calls. this is lame, since you were able to adjust the opacity of Windows in WinForms. i did not want to pInvoke, so i just closed the window.


    Here's a great application which is crippled by the fact that we have to jump outside the managed world and into a world of Win32 calls.

  • raluca

    I'd also like to bring up another point. Style triggers (which this idea of window templates / styling would use) allow developers to easily target such things and platforms (this will definantly be easier in the future) and user options. So let's say we allow the user to have an option of choosing to use Window's default chrome or the custom one we built. Hook the styles up to a trigger and you have a 0-code implementation. The user can choose in the options which window style to use (default or custom). No p/invoke calls, easy customization.

    Now, I understand there are some problems. Lets say you define a rectangle in the main window style that is transparent but has a BlurBitmapEffect. By definition, it should blur the desktop behind it. Is this possible to achieve using Win32 calls

  • Alex.P.

    I went ahead and sent you an e-mail with a little more explanation. Please excuse my ignorance of the Win32 API. I've rarely had to use it.
  • carluman

    Johann,

    If you want to draw your own chrome, the most straightforward way of doing so is to set

    window.WindowStyle = WindowStyle.None;

    ...and then draw your chrome within the "client" area of the Window.



  • Modify Window Chrome via templates?