Skip to content

Instantly share code, notes, and snippets.

@Clancey
Created December 17, 2021 07:10
Show Gist options
  • Save Clancey/66559660ac7892ba0e23b25bdc23b094 to your computer and use it in GitHub Desktop.
Save Clancey/66559660ac7892ba0e23b25bdc23b094 to your computer and use it in GitHub Desktop.
Added re-order buttons to the images
new ScrollView(Orientation.Horizontal){
new HStack{
Enumerable.Range(0,images.Value.Count).Select(x=> new VStack{
new Image(()=> images.Value[x].Path).Frame(width:100,height:100),
new Button("Remove", ()=>{
images.Value.RemoveAt(x);
Reload();
}),
(x >0 && x < images.Value.Count - 1) ? new HStack{
new Button("<--", ()=>{
var temp = images.Value[x];
images.Value[x] = images.Value[x-1];
images.Value[x-1] = temp;
Reload();
}).StyleAsConfirmButton(),
new Button("-->", ()=>{
var temp = images.Value[x];
images.Value[x] = images.Value[x+1];
images.Value[x+1] = temp;
Reload();
}),
} : new Spacer()
}),
}.Frame(height:110).Background(Colors.White)
}.Frame(height:240),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment