Wpf, style is not being applied

前端 未结 6 1893
执念已碎
执念已碎 2021-01-13 14:25

I\'ve written a user control with popup, who\'s content is being set outside the control. The ControlTemplate of that control looks like the following:



        
6条回答
  •  半阙折子戏
    2021-01-13 14:40

    I tried with your code example and this works :

     
                                    
                                        
                                    
                                    
                                        
                                    
                                
    

    That's kind of odd because when I put the Foreground setter for the Label control inside the ContentPresenter.Style then this time it's Label wich doesn't work...I think it's because Label is a considered as a ContentControl whereas TextBlock is just a FrameworkElement.

提交回复
热议问题