private MyDialogWindow CreateDialogWindow() { //var resources = Application.Current.MainWindow.Resources; var newWindow = new MyDialogWindow(); newWindow.SizeToContent = SizeToContent.WidthAndHeight; //newWindow.Resources = resources; return(newWindow); }
private void RemovePL_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { SettPopup.IsOpen = false; MyDialogWindow dialog = new MyDialogWindow(); dialog.TX.Text = "Удалить этот плейлист?"; dialog.Owner = this; dialog.ShowDialog(); if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { playLists.Remove((sender as TextBlock).DataContext as PlayList); //удаляем плейлист PL_ListBox.ItemsSource = new List <PlayList>(playLists); //обновляем окно плейлистов SetVisiblePlayListsControl(); //отображаем окно плейлистов CenterAnim(PListControl); } }
private void SetDialogWindowProperties <T>(MyDialogWindow newWindow, T viewModel) where T : ViewModelBase { newWindow.Title = viewModel.Title; newWindow.Content = viewModel; }