C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,465 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have set HorizontalScrollBarVisibility="Auto"
in my WPF application. My grid contains two graphs that adjust their height and width dynamically. However, when resizing the screen to a certain width where the scrollbar appears, the screen starts flickering due to the graph resizing.
Ideally the graphs should maintain a stable size and prevent excessive flickering when the scrollbar appears.
so how can i avoid flickering and what are best practices for handling dynamic resizing in this scenario?
<Grid Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <ContentControl Grid.Column="{Binding LeftPanelColumn}" FocusVisualStyle="{x:Null}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Content="{Binding LeftGraph, UpdateSourceTrigger=PropertyChanged}" /> <ContentControl Grid.Column="{Binding RightPanelColumn}" FocusVisualStyle="{x:Null}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Content="{Binding RightGraph, UpdateSourceTrigger=PropertyChanged}" /> </Grid>