Git Product home page Git Product logo

Comments (3)

mrlacey avatar mrlacey commented on May 29, 2024 1

@mstasak your ideas for changes to the way navigation works and issues with updating bindings may be better addressed by changes to the actual WinUI Framework, as they aren't things that can be changed as part of TemplateStudio. Discussion or issues there may be a better place to see if what you're after could be made possible.: https://github.com/microsoft/microsoft-ui-xaml

from templatestudio.

mrlacey avatar mrlacey commented on May 29, 2024

A page already has an OnNavigatingFrom method (which supports cancellation) and OnNavigatedFrom.

Historically, things like saving data have been left to the developer and not included in TemplateStudio because there are many potential variations and uncertainties.

  • Where should the data be saved?
  • In what format should it be saved?
  • What if the data is in an "incomplete" state (however that's defined) or doesn't meet app-specific validation requirements?
  • How should validation rules be defined or enforced?

Because the above will vary by app (and even within a single app), it's not deemed appropriate for TempalteStudio to include a single way of doing this. Additionally, it's not practical to provide multiple options due to the practicalities of creating and supporting them or presenting them in a way that would make it easy for people using the wizard to be confident in knowing what they would get based on their selections.

The official Windows Developer blog also includes a recent post that may be useful/relevant.

from templatestudio.

mstasak avatar mstasak commented on May 29, 2024

Thank you. Page.OnNavigatingFrom does work with some caveats. Some other method would be needed to detect app closing. e.Cancel = True will prevent navigating to another tab (NavigationViewItem) in a single page app with tab navigation, although the NavigationView will then be out of sync, reflecting the attempted change as if it were not canceled. The navigation attempt does not remove focus from an active TextBox, so it will not update its ViewController data source under the default binding update trigger mode for TextBoxes (UpdateSourceTrigger=LostFocus). Setting AllowFocusOnInteraction="True" on the NavigationView and NavigationViewItems does not help this. I've seen kludgy fixes involving changing the focused control prior to navigating, but wanted to avoid this (too hackish and might lose cursor and scroll positions). I guess I'll continue wrestling with this.

from templatestudio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.