public void CosCumparaturi(object obj) { if (File.ReadLines(@"..\..\..\Comanda.txt").Any(line => line.Contains(","))) { Cos cos = new Cos(); cos.ShowDialog(); } else { MessageBox.Show("Nu ati adaugat nimic la comanda!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } }