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); } }
public void CallMouseClick(object sender, MouseButtonEventArgs e) { //Image_MouseDown(sender, e); ImageDetails item = StaticClass.ImageListBoxSelectedItem; if (item != null) { int ind = ListBoxSnapshots.Items.IndexOf(item); ListBoxSnapshots.SelectedIndex = ind; ListBoxSnapshots.ScrollIntoView(item); ListBoxSnapshots.Focus(); StaticClass.ImageListBoxSelectedIndex = ind; } }
private void ListBoxSnapshots_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (e.AddedItems.Count > 0) { _selectedItem = e.AddedItems[0] as ImageDetails; ImageDetails item = e.AddedItems[0] as ImageDetails; if (item != null) { ListBoxSnapshots.ScrollIntoView(item); ServiceProvider.Settings.SelectedBitmap.DisplayEditImage = (WriteableBitmap)BitmapLoader.Instance.LoadImage(item.Path, BitmapLoader.LargeThumbSize, 0); StaticClass.ImageListBoxSelectedItem = item; //EditLeftControl.getInstance().Trigger_Event("Fixed",null); } } } catch (Exception) { } }