added keyboard navigation for selected images -> TOOD: allow visual keyboardnavigation when photo is not maximized
This commit is contained in:
@@ -91,10 +91,29 @@ public partial class MainWindowViewModel : ViewModelBase
|
||||
await SelectedPhoto.LoadFullImage();
|
||||
}
|
||||
|
||||
public void SelectedPhotoClicked()
|
||||
public void ResetSelectedPhoto()
|
||||
{
|
||||
if (SelectedPhoto is null) return;
|
||||
SelectedPhoto.FullImage = null;
|
||||
SelectedPhoto = null;
|
||||
}
|
||||
|
||||
public async Task TryFocusImage(int index)
|
||||
{
|
||||
if (index < 0 || index >= Photos.Count ) return;
|
||||
// if(SelectedPhoto != null) ResetSelectedPhoto();
|
||||
SelectedPhoto = Photos[index];
|
||||
await SelectedPhoto.LoadFullImage();
|
||||
}
|
||||
|
||||
public void UnfocusPhoto() => ResetSelectedPhoto();
|
||||
|
||||
public bool IsPhotoFocused() => SelectedPhoto != null;
|
||||
|
||||
public int GetImageIndex(Image i)
|
||||
{
|
||||
var p = Photos.FirstOrDefault(x => x.PreviewImage == i.Source);
|
||||
if (p is null) return -1;
|
||||
return Photos.IndexOf(p);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user