public void OnNext() { ChangingElement = true; foreach (var element in ListBoxItems) { if (element.IsActive && ListBoxItems.Count != ListBoxItems.IndexOf(element) + 1) { if (element.Filename == PresentationViewModelProp.FrontElement.Filename) { PresentationViewModelProp.BackElement = ListBoxItems[ListBoxItems.IndexOf(element) + 1]; if (PresentationViewModelProp.BackElement.Art == FileArt.Video) { PresentationProp.MediaElementBack.Position = TimeSpan.FromSeconds(0); } ScrollOffsetNextElmt = PresentationViewModelProp.BackElement.ScrollOffset; //Deckkraft Frontelement Runter Fahren Delay.Start(); } else { PresentationViewModelProp.FrontElement = ListBoxItems[ListBoxItems.IndexOf(element) + 1]; if (PresentationViewModelProp.FrontElement.Art == FileArt.Video) { PresentationProp.MediElementFront.Position = TimeSpan.FromSeconds(0); } ScrollOffsetNextElmt = PresentationViewModelProp.FrontElement.ScrollOffset; PresentationViewModelProp.FrontElement.IsVisible = true; //Deckraft Frontelement hochfahren Delay.Start(); } } } }
public void OnNextDirect(ListElementViewModel listElement) { if (PresentationViewModelProp.IsActive) { if (PresentationViewModelProp.FrontElement != null && PresentationViewModelProp.BackElement != null) { if (PresentationViewModelProp.FrontElement.IsActive) { PresentationViewModelProp.BackElement = ListBoxItems[ListBoxItems.IndexOf(listElement)]; ScrollOffsetNextElmt = PresentationViewModelProp.BackElement.ScrollOffset; //Deckkraft Frontelement Runter Fahren Delay.Start(); } else { PresentationViewModelProp.FrontElement = ListBoxItems[ListBoxItems.IndexOf(listElement)]; ScrollOffsetNextElmt = PresentationViewModelProp.FrontElement.ScrollOffset; PresentationViewModelProp.FrontElement.IsVisible = true; //Deckraft Frontelement hochfahren Delay.Start(); } } } else { OnStart(listElement); } }
private void DelayLoadBackground_Tick(object sender, EventArgs e) { DelayLoadBackground.Stop(); ListElementViewModel nextElm = null; if (PresentationViewModelProp.FrontElement.IsActive) { if (ListBoxItems[ListBoxItems.Count - 1].Filename != PresentationViewModelProp.FrontElement.Filename) { foreach (var item in ListBoxItems) { if (item.IsActive) { nextElm = ListBoxItems[ListBoxItems.IndexOf(item) + 1]; } } PresentationViewModelProp.BackElement = nextElm; } } else { if (ListBoxItems[ListBoxItems.Count - 1].Filename != PresentationViewModelProp.BackElement.Filename) { foreach (var item in ListBoxItems) { if (item.IsActive) { nextElm = ListBoxItems[ListBoxItems.IndexOf(item) + 1]; nextElm.IsVisible = false; } } PresentationViewModelProp.FrontElement = nextElm; } } }