0
我有下面的XAML代碼:添加WPF組件在C#/ SQL Server的使用實體框架
<Canvas x:Name="msg1" Height="71" Canvas.Left="10" Canvas.Top="10" Width="389.333" Background="#FFE4E4E4">
<Ellipse x:Name="photo_Copy" Height="46.5" Width="47.023" Canvas.Left="10" Canvas.Top="14.5" RenderTransformOrigin="0.473,0.482">
<Ellipse.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Ellipse.RenderTransform>
<Ellipse.Fill>
<ImageBrush ImageSource="user11.png"/>
</Ellipse.Fill>
</Ellipse>
<TextBlock x:Name="textBlock" Height="19.251" Canvas.Left="63.876" TextWrapping="Wrap" Text="Paulinho da Serra" Canvas.Top="10" Width="131.334"/>
<TextBlock x:Name="textBlock_Copy" Height="19.251" Canvas.Left="313.999" TextWrapping="Wrap" Text="07/01/2017" Canvas.Top="10" Width="65.334"/>
<Canvas Height="31.749" Canvas.Left="63.876" Canvas.Top="29.251" Width="315.457" Background="#FFD4D4D4">
<TextBlock x:Name="textBlock1" Height="31.749" TextWrapping="Wrap" Text="Olá, Bom dia!" Width="295.457" Margin="0" VerticalAlignment="Center" Canvas.Left="10" HorizontalAlignment="Center"/>
</Canvas>
</Canvas>
這將是負責加載一條短信到你的textblock1,它會從數據庫中...而整個Canvas
位於Scrollviewer
之內。我希望當我有一條以上的消息時,他會在Scrollviewer
內重複這個Canvas
,並且保持第一個...一些光線?我想不出任何事情。
但是,如何繪製畫布到每個列表項? –