How do you do a gradient fade to Aero glass in a WPF application like Office 2010 does?

后端 未结 2 2081
礼貌的吻别
礼貌的吻别 2021-02-10 13:21

I am writing an application in WPF and I would like to have the top of the application fade from a color to Aero glass like the Office 2010 applications.

Really it will

2条回答
  •  独厮守ぢ
    2021-02-10 13:30

    I figured out how to get it to work. I set the entire window to have the aero glass effect on it using the native API's and then a create a LinearGradientBrush for my background of the window. In the brush I used the Alpha properties of the brush and set the stops to have the top of the window go from white/opaque to white/transparent all very close to the top of the window.

    
            
                
                    
                    
                    
                    
                
            
    
    

    I 1 up'd Mikko Rantanen's answer because I used the article to add the glass effect I didn't have the code handy and it was a good simple article.

提交回复
热议问题