samedi 5 janvier 2019

How to approach multi-page dynamic UI in WPF?

I'm new to WPF and I'm trying to understand exactly how to build a dynamic UI with simple sliding animations using XAML/C#. It's a photo album app where the user can add photos to an album, name/edit those photos, and switch between albums. The albums and photo data is stored in a separate file which would be loaded at runtime and will also change during runtime as the user adds/edits/removes albums+photos.

The albums will "wrap around" so if the user is viewing the last album called "D", they can move to the left to view "C", or move to the right to view "A". The photos will slide off/on to with the direction of the album selection.

Photos rows will also slide up or down depending on the currently selected photo. Two rows of photos will be shown at once.

I'm struggling mostly with the best way to manage all these pages dynamically during runtime and how to structure the project properly. Is there a specific component within WPF that is best suited for the behavior described above? What parts of the app should be done in XAML? My instinct is to do it all in code-behind because that's what I'm used to but I know that's probably not the best approach.

Here's a rough photo of the layered structure of each page. The top and bottom bars/buttons in the second layer are always there, and it's only the text that changes based on what album/photo is selected.

layers

Aucun commentaire:

Enregistrer un commentaire