示例#1
0
        private void SelectImage(object sender, RoutedEventArgs e)
        {
            Button b = sender as Button;

            ClientEntities.Image image = b.CommandParameter as ClientEntities.Image;
            selectedImage    = image;
            this.DataContext = selectedImage;
        }
示例#2
0
 public Pictures()
 {
     imageService = new SimpleImageService(new SimpleConnectionCreater());
     InitializeComponent();
     myPictures = new ObservableCollection <ClientEntities.Image>(imageService.GetAll());
     if (myPictures.ToArray().Length > 0)
     {
         selectedImage = myPictures.ToArray()[0];
     }
     pictures.ItemsSource = myPictures;
     this.DataContext     = selectedImage;
 }