wpf 中的DataTemplate 绑定控件

时间:2024-08-29 23:08:08

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tk="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:local="using:Xiaowei.Themes"
xmlns:controls="using:Xiaowei.Controls">
  <Style TargetType="ListViewItem"
    x:Key="ListItemStyleForPlayer">
    <Setter Property="Margin"
    Value="0, 0, 0, 0" />
    <Setter Property="TabNavigation"
    Value="Local" />
    <Setter Property="Template"
    Value="{ThemeResource ListItemControlTemplateForPlayer}"></Setter>
  </Style>  

<DataTemplate x:Key="DriverMessageDataTemplate">
  <tk:DropShadowPanel>
  <Grid HorizontalAlignment="Left">
  <Grid Background="#ffffff" CornerRadius="0,8,8,8">
  <controls:DriverListBubble DriverMessage="{Binding Self}"/>
  </Grid>
  </Grid>
  </tk:DropShadowPanel>
</DataTemplate>