Subversion Repository Public Repository

Nextrek

Diff Revisions 751 vs 752 for /Android/SmartCharging/SmartCharging_WP/SmartCharging/MultipleImagePicker.xaml.cs

Diff revisions: vs.
  @@ -30,6 +30,7 @@
30 30 FileOpenPicker filePicker;
31 31 CoreApplicationView view;
32 32 public ObservableCollection<StorageFile> images;
33 + public ObservableCollection<object> initialImages;
33 34 ErrorHandler errorHandler;
34 35 ResourceLoader resourceLoader;
35 36
  @@ -38,6 +39,7 @@
38 39 {
39 40 this.InitializeComponent();
40 41 this.images = new ObservableCollection<StorageFile>();
42 + this.initialImages = new ObservableCollection<object>();
41 43 errorHandler = new ErrorHandler();
42 44
43 45 this.PreviewList.ItemsSource = images;
  @@ -78,6 +80,14 @@
78 80 images.Remove(dc);
79 81 }
80 82
83 + private void AppBarButton_Tapped2(object sender, TappedRoutedEventArgs e)
84 + {
85 + Control c = sender as Control;
86 + object dc = c.DataContext as object;
87 +
88 + initialImages.Remove(dc);
89 + }
90 +
81 91 private async void AddImagesButton_Tapped(object sender, TappedRoutedEventArgs e)
82 92 {
83 93 this.resourceLoader = ResourceLoader.GetForCurrentView("Resources");
  @@ -104,5 +114,15 @@
104 114 {
105 115 this.ImagePreviewFlyout.Hide();
106 116 }
117 +
118 + public void setInitialImages(List<Uri> paths)
119 + {
120 + for (int i = 0; i < paths.Count; i++)
121 + {
122 + initialImages.Add(new { Path = paths[i]});
123 + }
124 +
125 + this.InitialPreviewList.ItemsSource = initialImages;
126 + }
107 127 }
108 128 }