dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.01k stars 1.16k forks source link

ScrollViewer background property affects the background property of the Textbox #5752

Open vsfeedback opened 2 years ago

vsfeedback commented 2 years ago

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] I created a Scrollviewer style with brackground="blue" and a TextBox style with background="yellow". When i am debugging my project, the background from all textboxes dont change to yellow rather it change to blue. So i delete my style of textbox and create a new one with same parameters, but it didnt work. After a long time i found the issue. The style of the ScrollViewer affects to the style of the TextBox, i dont know why.. but when i give the style of scrollviewer a x:key, the background from textbox change to blue, like i want.

i hope my english is not so bad and you will understand my problem, but for sure.. i load some screenshots up.

And here is my Xaml-Code. In this example the only one ScrollViewer is a part from the GameRules and is commented out, for see the problem. Else we would see the overlaped view "Game Rules".

Xaml-Code:

    <Border Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4" Grid.RowSpan="4" Width="800" Height="800" Background="Green" Visibility="{Binding

GameSettingsVisibility}" >

singhashish-wpf commented 2 years ago

Please share a minimal repro to check this further.