The initial version is very simple and hopefully the behaviour is obvious - the image flanked by a couple of buttons for moving to the next\previous image:
The XAML for this is very simple, using grid layout to achieve the alignment required, one thing to note is the Stretch characteristics of the Image control - the image ratio will be maintained as the app is resized. Also I'm using the default (implicit) styling for the button controls, these come from the MahApps libraries:
The next iteration sees the 'cleaning up' of the actual UI elements - the removal of border from around all the controls and the applying of the flat button style to the next & previous buttons.
The other majors changes are the replacement of the 'next' & 'previous' text with a couple of icons implemented as Path embedded on a Canvas, and the moving of the buttons to on top of the image - this obviously is now not ideal because it's obscuring parts of the image:
The XAML has changed subtly, the Image now spans all the columns in the Grid and each Button content has been replaced with a styled VisualBrush:
The Visual for the next button is defined as follows:
The final version isn't that different to the previous, the most obvious change is the use of Property Triggers to control the Opacity of the buttons - the buttons only become visible when the mouse is moved over there location, this means for the majority of the time the whole image will be visible and not obscured by the buttons.
The XAML is now simpler - mainly because the styling has been abstracted away into a separate style resource dictionary:The complexity (which isn't very complex really) is moved into the styling for the buttons:
Comments
Post a Comment