This answer can help you: How can I get control in DataTemplate?
Also article about getting access to cotrol in DataTemmplate(but for WPF):
質問
<DataTemplate x:Name="SoundTitleTemplate">
<ProgressBar x:Name="bar" Visibility="Visible" Height="0" Margin="20,30,130,0" />
</DataTemplate>
in cs
private void _webClient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
try
{
if (_downloadCanceled)
return;
if (bar.Value <= bar.Maximum)
{
bar.Value = e.ProgressPercentage;
bar.Text = string.Format("{0}%", e.ProgressPercentage);
}
}
}
I got search any this topic, but no get help :( If you have any method, please show me, i try what i found, in the end is fail ~.~
解決
This answer can help you: How can I get control in DataTemplate?
Also article about getting access to cotrol in DataTemmplate(but for WPF):