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

Bugfixes in windows phone user control and samples #102

Closed
wants to merge 2 commits into from

Conversation

jjchiw
Copy link

@jjchiw jjchiw commented Apr 9, 2014

In the sample project when you try to enter for second time in the custom layout there was an exception, because the custom layer is never detached from the previous ScanPage.xaml

this was the exception

'gridCustomOverlay.Children.Add(CustomOverlay)' threw an exception of type 'System.InvalidOperationException' base: {System.InvalidOperationException: Element is already the child of another element.
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject
value)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement
value)
at System.Windows.PresentationFrameworkCollection`1.Add(T value)}

In the sample.

The action to the buttons (cancel and torch) of the custom layer were only added once, because the buttons where already wired with an action.

All the events in ScanPage are set to null when it's navigated from the
page, because the Events are static and we were adding action everytime
we navigated to the page

In the sample project when you try to enter for second time in the
custom layout there was an exception, because the custom layer is never
detached from the previous ScanPage.xaml

this was the exception
'gridCustomOverlay.Children.Add(CustomOverlay)' threw an exception of
type 'System.InvalidOperationException'
base: {System.InvalidOperationException: Element is already the child of
another element.
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at
MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1
collection, CValue value)
at
MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1
collection, DependencyObject value)
at
System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject
value)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement
value)
at System.Windows.PresentationFrameworkCollection`1.Add(T value)}

The action to the buttons (cancel and torch) of the custom layer were
only added once, because the buttons where already wired with an action.

All the events in ScanPage are set to null when it's navigated from the
page, because the Events are static and we were adding action everytime
we navigated to the page
@Redth
Copy link
Owner

Redth commented Apr 10, 2014

Thanks I'll take a look at this soon!

@Redth Redth added the bug label Apr 10, 2014
Redth added a commit that referenced this pull request Apr 14, 2014
@Redth
Copy link
Owner

Redth commented Apr 14, 2014

I've manually merged these suggestions, thanks again :)

@Redth Redth closed this Apr 14, 2014
@jjchiw
Copy link
Author

jjchiw commented Apr 14, 2014

Great!........I'm glad to contribute.

Cheers!

On Mon, Apr 14, 2014 at 4:28 PM, Jon Dick [email protected] wrote:

I've manually merged these suggestions, thanks again :)


Reply to this email directly or view it on GitHubhttps://github.com//pull/102#issuecomment-40371615
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants