How I can convert like:
var me = ((FrameworkElement)sender).Tag as ListBoxItem as Data;
_
public class Data {
public string url { get; set; }
public string title { get; set; }
}
<Button Click="PlayMedia" Tag="{Binding}" Content="Play" />
Assuming that this code is in the PlayMedia event handler, you can do:
If the button is contained in a ListBoxItem, then you’d have to use VisualTreeHelper to find it up the visual tree, starting with the button.