private void TriggerEvent(string cmd, object o) { try { __Pathupdate = PathUpdate.getInstance(); switch (cmd) { case WindowsCmdConsts.Next_Image: if (ListBoxSnapshots.SelectedIndex < ListBoxSnapshots.Items.Count - 1) { ImageDetails item = ListBoxSnapshots.SelectedItem as ImageDetails; if (item != null) { int ind = ListBoxSnapshots.Items.IndexOf(item); ListBoxSnapshots.SelectedIndex = ind + 1; StaticClass.ImageListBoxSelectedIndex = ind; } item = ListBoxSnapshots.SelectedItem as ImageDetails; if (item != null) { ListBoxSnapshots.ScrollIntoView(item); ServiceProvider.Settings.SelectedBitmap.DisplayEditImage = (WriteableBitmap)BitmapLoader.Instance.LoadImage(item.Path, BitmapLoader.LargeThumbSize, 0); __Pathupdate.PathImg = item.Path_Orginal; StaticClass.ImageListBoxSelectedItem = ListBoxSnapshots.SelectedItem as ImageDetails; } } break; case WindowsCmdConsts.Prev_Image: if (ListBoxSnapshots.SelectedIndex > 0) { ImageDetails item = ListBoxSnapshots.SelectedItem as ImageDetails; if (item != null) { int ind = ListBoxSnapshots.Items.IndexOf(item); ListBoxSnapshots.SelectedIndex = ind - 1; } StaticClass.ImageListBoxSelectedItem = ListBoxSnapshots.SelectedItem as ImageDetails; item = ListBoxSnapshots.SelectedItem as ImageDetails; if (item != null) { ListBoxSnapshots.ScrollIntoView(item); ServiceProvider.Settings.SelectedBitmap.DisplayEditImage = (WriteableBitmap)BitmapLoader.Instance.LoadImage(item.Path, BitmapLoader.LargeThumbSize, 0); __Pathupdate.PathImg = item.Path_Orginal; //clickedOnItem.Source.ToString(); } } break; } } catch (Exception exception) { Log.Error("Unable to process event ", exception); } }
_dynamicSortBoxLogic = new DynamicSortBoxLogic( type, displaySource, ChangeFilterPosition, ChangeEnambeBackBattons, PathUpdate, PrintUpdate, FiltersChange, SetUpEnable, SetDownEnable, UpdateTree, Selected);
private void Image_MouseDown(object sender, MouseButtonEventArgs e) { //SelectedImage.Imagepath = ImageLIstBox. Image clickedOnItem = (Image)GetParentDependencyObjectFromVisualTree((DependencyObject)e.MouseDevice.DirectlyOver, typeof(Image)); if (clickedOnItem != null) { __Pathupdate = PathUpdate.getInstance(); __Pathupdate.PathImg = ((ImageDetails)clickedOnItem.DataContext).Path_Orginal; //clickedOnItem.Source.ToString(); ServiceProvider.Settings.EditImageByte = DSLR_Tool_PC.StaticClass.ConvertImageToByteArray(__Pathupdate.PathImg); //.Substring(8)) ;// ; //converterDemo(clickedOnItem); ServiceProvider.Settings.SelectedBitmap.DisplayEditImage = (WriteableBitmap)BitmapLoader.Instance.LoadImage(__Pathupdate.PathImg, BitmapLoader.LargeThumbSize, 0); //PhotoEditModel.GetInstance().ImagePath = Pathupdate.PathImg.Substring(8); PhotoEditModel.GetInstance().ImageData = ServiceProvider.Settings.EditImageByte; } }
/// <summary> /// Creates the path async. /// </summary> /// <returns>The path async.</returns> public IObservable <Unit> CreatePathAsync(GoogleMapsTravelModes travelMode) { IsLoading = true; IsError = false; _currentTravelMode = travelMode; var startCoordinate = new GeoCoordinate(CurrentLocation.Latitude, CurrentLocation.Longitude); return(GoogleMapsWebServiceController .GetDirectionsPolyLine(startCoordinate, _endCoordinate, _currentTravelMode) .ObserveOn(this.Scheduler) .Catch <GoogleGeocodeContract, Exception>(error => { DidException(error, "Select failed using call to web service GetEReactiveUIAroundMeById"); return Observable.Empty <GoogleGeocodeContract>(); }) .Do(geocode => { IsLoading = false; var routes = geocode.Routes; var route = routes?.Length > 0 ? routes[0] : null; if (route != null) { var polyline = route.Bounds; var path = CreatePath(route.OverviewPolyline.Points); // update new path PathUpdate?.Invoke(this, new PathUpdateEventArgs() { StartCoordinate = startCoordinate, EndCoordinate = _endCoordinate, Path = path, }); } }).Select(x => Unit.Default)); }
private void TriggerEvent(string cmd, object o) { try { bool status = false; ListBox lstBox = null; if (tab_folder_VL.IsSelected) { lstBox = ImageListBox_Folder; status = true; } if (tab_folder_VG.IsSelected) { lstBox = ImageLIstBox_Folder; status = true; ImageLIstBox_Folder.SelectedIndex = StaticClass.ImageListBoxSelectedIndex + 1; ImageLIstBox_Folder.ScrollIntoView(StaticClass.ImageListBoxSelectedItem); } if (tab_history_VL.IsSelected) { lstBox = ImageListBox; status = true; } if (tab_history_VG.IsSelected) { lstBox = ImageLIstBox; status = true; } if (status == false) { lstBox = ImageLIstBox_Folder; } __Pathupdate = PathUpdate.getInstance(); switch (cmd) { case WindowsCmdConsts.Next_Image: if (lstBox.SelectedIndex < lstBox.Items.Count - 1) { ImageDetails item = lstBox.SelectedItem as ImageDetails; if (item != null) { int ind = lstBox.Items.IndexOf(item); lstBox.SelectedIndex = ind + 1; } item = lstBox.SelectedItem as ImageDetails; if (item != null) { lstBox.ScrollIntoView(item); ServiceProvider.Settings.SelectedBitmap.DisplayEditImage = (WriteableBitmap)BitmapLoader.Instance.LoadImage(item.Path, BitmapLoader.LargeThumbSize, 0); __Pathupdate.PathImg = item.Path_Orginal; } } break; case WindowsCmdConsts.Prev_Image: if (lstBox.SelectedIndex > 0) { ImageDetails item = lstBox.SelectedItem as ImageDetails; if (item != null) { int ind = lstBox.Items.IndexOf(item); lstBox.SelectedIndex = ind - 1; } item = lstBox.SelectedItem as ImageDetails; if (item != null) { lstBox.ScrollIntoView(item); ServiceProvider.Settings.SelectedBitmap.DisplayEditImage = (WriteableBitmap)BitmapLoader.Instance.LoadImage(item.Path, BitmapLoader.LargeThumbSize, 0); __Pathupdate.PathImg = item.Path_Orginal; //clickedOnItem.Source.ToString(); } } else { if (StaticClass.ImageListBoxSelectedItem != null) { ImageDetails item = StaticClass.ImageListBoxSelectedItem; if (item != null) { int ind = lstBox.Items.IndexOf(item); lstBox.SelectedIndex = ind - 1; } } } break; case "Fixed": if (lstBox.Items.Count > 0) { ImageDetails item = StaticClass.ImageListBoxSelectedItem; if (item != null) { int ind = lstBox.Items.IndexOf(item); lstBox.SelectedIndex = ind; } item = lstBox.SelectedItem as ImageDetails; } break; } } catch (Exception exception) { Log.Error("Unable to process event ", exception); } }