Unplanned
Last Updated: 21 Jun 2024 08:11 by Martin Ivanov
Martin Ivanov
Created on: 21 Jun 2024 08:11
Category: Chat
Type: Bug Report
1
Chat: Scrolling feels jerky when having messages with different heights

The scrolling in RadChat feels incosistent and not smooth when having messages with different heights.

To work around this you can modify the ControlTemplate of ChatMessageList in order to set the Background property of the ScrollViewer element to a value different than null. For example, Transparent.

 <Application.Resources>
     <ResourceDictionary>
         <ResourceDictionary.MergedDictionaries>
             <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
			 <ResourceDictionary Source="ms-appx:///Telerik.WinUI.Controls/Themes/Generic.xaml"/>
			 <!-- Other merged dictionaries here -->
         </ResourceDictionary.MergedDictionaries>
			<!-- Other app resources here -->

		<Style  TargetType="chat:ChatMessageList" BasedOn="{StaticResource ChatMessageListStyle}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="chat:ChatMessageList">
						<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
							<!--The background of the Scrollviewer is set here-->
							<ScrollViewer x:Name="PART_ScrollViewer" 
										  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" 
										  BorderThickness="0"
										  Background="Transparent">
								<ItemsPresenter Margin="{TemplateBinding Padding}" />
							</ScrollViewer>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</ResourceDictionary>
 </Application.Resources>

0 comments