Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MasterDetailsView: fixed loaded bug #1193

Merged
merged 2 commits into from
May 31, 2017
Merged

MasterDetailsView: fixed loaded bug #1193

merged 2 commits into from
May 31, 2017

Conversation

nmetulev
Copy link
Contributor

When initial visibility of MasterDetailsView is collapsed, Loaded gets called before template is applied, and an exception is thrown. This fix should resolve the issue.

@nmetulev nmetulev added this to the v1.5 milestone May 31, 2017
@nmetulev nmetulev requested a review from skendrot May 31, 2017 04:03
_stateGroup = (VisualStateGroup)GetTemplateChild(WidthStates);
if (_stateGroup != null)
{
_stateGroup.CurrentStateChanged += OnVisualStateChanged;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to unwire this when it's unloaded.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@skendrot
Copy link
Contributor

Not arguing that this needs to be fixed, but why would the view be set to collapsed? Is x:DeferLoad a better approach for whatever you're trying to do?

@nmetulev
Copy link
Contributor Author

@skendrot, agree on setting x:Load vs Visibility, that should definitely be the right approach.

@shenchauhan shenchauhan merged commit f55a4c5 into dev May 31, 2017
@shenchauhan shenchauhan deleted the masterdetailsviewfix branch June 1, 2017 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants