Witajcie ! :)
Mam taki UserControl. Jak widać przyjmuje on argumenty w konstruktorze.
namespace Media_Player.controls
{
/// <summary>
/// Interaction logic for PlayList.xaml
/// </summary>
public partial class PlayList : INotifyPropertyChanged
{
cDataBase DataBase;
// Property Changed
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
var handler = this.PropertyChanged;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
}
public PlayList(cDataBase DataBase, IList<cTrack> List)
{
this.DataBase = DataBase;
CurrentlyPlaying = null;
hDataGrid.DataContext = this;
hDataGrid.ItemsSource = List;
InitializeComponent();
}
Teraz w WPF jak utworzyć taką kontrolkę? Jak wypełnić argumenty konstruktora?
<!--PlayLista-->
<my:PlayList Grid.Column="2" Grid.Row="2" Name="PlayListControl"/>