wpf - Exception occur when fast click -
i run wpf in vb.net. page consist of 6 category. each category navigate own page. let's first page fashion,followed eateries,services,health,specialty , interior. when click normal person, not having problem. when fast click, speeding click eateries services,then health time, goes exception @ code right @ function navigate. why happen on fast click? steady click not having problem.
exception goes @ navigate title "system.nullreferenceexception unhandled":
private sub navigate() select case mytab case 1 navigationservice.navigate(new uri(gotocategory1screen, urikind.relativeorabsolute)) case 2 navigationservice.navigate(new uri(gotocategory2screen, urikind.relativeorabsolute)) case 3 navigationservice.navigate(new uri(gotocategory3screen, urikind.relativeorabsolute)) case 4 navigationservice.navigate(new uri(gotocategory4screen, urikind.relativeorabsolute)) case 5 navigationservice.navigate(new uri(gotocategory5screen, urikind.relativeorabsolute)) case 6 navigationservice.navigate(new uri(gotocategory6screen, urikind.relativeorabsolute)) end select end sub any ways handle this?
usually fast click not issue have method not utilize uri hence not require initialization uri
you can utilize other on load of navigationservice.navigate uses instance instead of uri, can guarantee initialization has been done before navigation. enable observe error source, initialization or navigation.
eg
category1screen screen1 = new category1screen(); navigationservice.navigate(screen1); above class category1screen sample, have utilize actual classes.
that should solve issue, if issue still persist missing concerned code, may have within initialization code of screens
wpf vb.net nullreferenceexception
No comments:
Post a Comment