using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WPF_USE_LINQ
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void btnshowdata_Click(object sender, RoutedEventArgs e)
{
//USE OF LINQ
int[] number = { 1, 4, 5, 6, 7, 8, 9, 2, 3, 4, 7, 0, 12, 6 };
listVdata.ItemsSource = from num in number
where num%2==0
select num;
}
}
}
Comments
Post a Comment