Following up on my previous post;
Windows 10 UWP–Migrating a Windows 8.1 App (Part 1 of N where N tends to infinity)
I figured that the initial step was to move from my very Windows 8.1 UI to a more Windows 10 UI and, in some ways, I see this as moving from a very tablet-centric UI more to a desktop centric UI that can also accommodate working on a tablet.
In all honesty, the code-base for my kwiQR application isn’t beautiful but it’s really not that bad either (if I say so myself!) – it’s pretty much an MVVM + S (Services) style approach and there are clearly defined layers of Views, ViewModels, Models and some services including services which store/retrieve data, which handle navigation and which talk to the camera but, looking at it today, it’s about 80% as ‘clean’ as I would like it to be and I spent a lot of time wondering whether it might just be better to rewrite the whole thing and start again by assembling some of the pieces but I decided against it.
I took a look at a few common Windows 10 apps like;
and I figured that I’d try and do something similar although I’d point out that neither of these apps seem to integrate the back button in a way that I recognise and I’m not sure how they work in tablet mode but, at the time of writing, I can’t confirm because my tablet mode seems to have broken.
After some swearing and cursing my UI now looks like this;
and, presently, it is possible to navigate to the camera page which (clearly) still has some issues (including ones that you can’t see);
and I can navigate back and so on and that all kind of works. Navigating to the settings page doesn’t work as it doesn’t go anywhere just yet. Once I’ve scanned some QR codes;
the UI is still pretty broken but what I’ve focused on here in this very simple, 2.5 (0.5 for settings) page app is moving from a situation where I had;
to one where I now have;
Now you can argue (no doubt) about whether that outer Page within the Window should be a Page, maybe it should be a UserControl but, regardless, making this simple change had more of an impact on my code than I expected including impact on my navigation service, my suspend/resume/terminate code, the places where I’d used AppBars and so on.
I’d say that I spent maybe an hour or two sorting that out and getting the app back into a state where it’s essentially presenting a hierarchy of;
Window<-Page<-Split View<- Frame & Navigation Controls
and then I have a modified navigation service that has a ‘link’ with that Frame and knows how to navigate it back/forth to the 3 pages of the app.
The next job would be to start to try and fix up those app pages a little.
I’d say that I spent maybe 2 hours at this step of shuffling around a very basic UI and I haven’t finished yet. More to come…