mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
聊天框超过大小时自动滚动到最底层
This commit is contained in:
parent
ead7115ac9
commit
b61b4996f2
@ -21,10 +21,10 @@
|
||||
<Label x:Name="LName" Content="虚拟桌宠名字:" Foreground="{DynamicResource PrimaryText}"
|
||||
HorizontalAlignment="Left" Padding="0" FontWeight="Bold" Margin="0,0,0,6" FontSize="32"
|
||||
Background="{x:Null}" />
|
||||
<ScrollViewer MaxHeight="400">
|
||||
<ScrollViewer x:Name="sv" MaxHeight="400">
|
||||
<TextBox x:Name="TText" Text="我说话长这样,这是我说的话巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉" IsReadOnly="True"
|
||||
TextWrapping="WrapWithOverflow" FontSize="24" x:FieldModifier="public" Background="{x:Null}"
|
||||
BorderBrush="{x:Null}" BorderThickness="0" />
|
||||
BorderBrush="{x:Null}" BorderThickness="0" SizeChanged="TText_SizeChanged" />
|
||||
</ScrollViewer>
|
||||
<Grid x:Name="MessageBoxContent" x:FieldModifier="public">
|
||||
|
||||
|
@ -221,5 +221,10 @@ namespace VPet_Simulator.Core
|
||||
private void ContextMenu_Opened(object sender, RoutedEventArgs e) => Border_MouseEnter(null, null);
|
||||
|
||||
private void ContextMenu_Closed(object sender, RoutedEventArgs e) => Border_MouseLeave(null, null);
|
||||
|
||||
private void TText_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
sv.ScrollToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -249,12 +249,12 @@ namespace VPet_Simulator.Core
|
||||
public event Action EventShow;
|
||||
public void Show()
|
||||
{
|
||||
EventShow?.Invoke();
|
||||
if (m.UIGrid.Children.IndexOf(this) != m.UIGrid.Children.Count - 1)
|
||||
{
|
||||
Panel.SetZIndex(this, m.UIGrid.Children.Count);
|
||||
}
|
||||
Visibility = Visibility.Visible;
|
||||
EventShow?.Invoke();
|
||||
if (CloseTimer.Enabled)
|
||||
onFocus = true;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user