You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The general assumption here is that Win8 controls that consume or produce data should support data binding, and in the case of the LoginButton, which does both, it should support "TwoWay" data binding (for at least CurrentSession, and ideally CurrentUser as well).
The LoginButton intentionally obscures/protects the CurrentSession and CurrentUser, making it very hard to integrate a LoginButton into an app of any complexity or sophistication (a "real" app) without some non-trivial code-behind. Ideally, these values should be exposed so they can be bound to a ViewModel (or equivalent) using TwoWay binding, allowing them to be initialized from app state (ViewModel) when a page is loaded, and allowing the ViewModel (or equivalent) to be automatically notified when they change (based on user interaction with the control).
The only way to do this right now, as far as I can tell, is to have a bunch of code-behind that initializes the values using SetValue on the button, and that responds to the session state changed and user changed events in the view, which is fairly creepy and certainly not in keeping with separation of concerns (MVVM, etc).
In a real world app where you are separating the view from the rest of the app logic (so, for example, your designers can work on the UX in Blend), you don't want any code that you don't absolutely need in the view code-behind, and you wouldn't need any of that if the LoginButton supported TwoWay data binding for these values.
The text was updated successfully, but these errors were encountered:
The general assumption here is that Win8 controls that consume or produce data should support data binding, and in the case of the LoginButton, which does both, it should support "TwoWay" data binding (for at least CurrentSession, and ideally CurrentUser as well).
See this "question" on StackOverflow: http://stackoverflow.com/questions/18269169/facebook-c-sharp-sdk-loginbutton-state-management
The LoginButton intentionally obscures/protects the CurrentSession and CurrentUser, making it very hard to integrate a LoginButton into an app of any complexity or sophistication (a "real" app) without some non-trivial code-behind. Ideally, these values should be exposed so they can be bound to a ViewModel (or equivalent) using TwoWay binding, allowing them to be initialized from app state (ViewModel) when a page is loaded, and allowing the ViewModel (or equivalent) to be automatically notified when they change (based on user interaction with the control).
The only way to do this right now, as far as I can tell, is to have a bunch of code-behind that initializes the values using SetValue on the button, and that responds to the session state changed and user changed events in the view, which is fairly creepy and certainly not in keeping with separation of concerns (MVVM, etc).
In a real world app where you are separating the view from the rest of the app logic (so, for example, your designers can work on the UX in Blend), you don't want any code that you don't absolutely need in the view code-behind, and you wouldn't need any of that if the LoginButton supported TwoWay data binding for these values.
The text was updated successfully, but these errors were encountered: