I changed the example DragAndDrop (first look) a little and have everything working great, but I want to be able to update the ContentControl.ContentTemplate(DataTemplate).
I re-dedinfed the DataTemplate (below) and I'm trying to get a reference to TextBlock defined in the the DataTemplate during the execution of OnDragQuery so I can set the .Text of the TextBlock.
DataTemplate defined (which has a TextBlock):
<DataTemplate x:Key="ApplicationDragTemplate">
<StackPanel>
<Border BorderBrush="DarkGray" BorderThickness="1" Width="40" Height="40">
<Canvas>
<Rectangle Width="38" Height="38" Canvas.Left="0" Canvas.Top="0" Stroke="DarkGray" Margin="0, 0, 0, 0" HorizontalAlignment="Center" VerticalAlignment="Center" UseLayoutRounding="False" RadiusY="0" RadiusX="0">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#00000000" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<TextBlock Text="401" FontWeight="Bold" Foreground="DarkGray" Width="35" Canvas.Left="3" Canvas.Top="2" />
</Canvas>
</Border>
</StackPanel>
</DataTemplate>
I re-dedinfed the DataTemplate (below) and I'm trying to get a reference to TextBlock defined in the the DataTemplate during the execution of OnDragQuery so I can set the .Text of the TextBlock.
DataTemplate defined (which has a TextBlock):
<DataTemplate x:Key="ApplicationDragTemplate">
<StackPanel>
<Border BorderBrush="DarkGray" BorderThickness="1" Width="40" Height="40">
<Canvas>
<Rectangle Width="38" Height="38" Canvas.Left="0" Canvas.Top="0" Stroke="DarkGray" Margin="0, 0, 0, 0" HorizontalAlignment="Center" VerticalAlignment="Center" UseLayoutRounding="False" RadiusY="0" RadiusX="0">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#00000000" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<TextBlock Text="401" FontWeight="Bold" Foreground="DarkGray" Width="35" Canvas.Left="3" Canvas.Top="2" />
</Canvas>
</Border>
</StackPanel>
</DataTemplate>