C# Windows phone visible more objects -


i'm using ms visual studio 2013.

i'm making universal application windows phone 8.1.

after textblock value become grater or equal 22, images should become visible. if value less 22 images should invisible.

this examples tried:

private void points_loaded(object sender, routedeventargs e) {      int n = 0;     bool b = int.tryparse(points.text, out n);      if (b && n <= 22)     {         hole10img.visibility = windows.ui.xaml.visibility.collapsed;         hole11img.visibility = windows.ui.xaml.visibility.collapsed;         hole12img.visibility = windows.ui.xaml.visibility.collapsed;         hole13img.visibility = windows.ui.xaml.visibility.collapsed;         hole14img.visibility = windows.ui.xaml.visibility.collapsed;         hole15img.visibility = windows.ui.xaml.visibility.collapsed;         hole16img.visibility = windows.ui.xaml.visibility.collapsed;         hole17img.visibility = windows.ui.xaml.visibility.collapsed;         hole18img.visibility = windows.ui.xaml.visibility.collapsed;     } } 

my test sample

after start app, cant see more hole image while textblock value become grater or equal 22. after user gets 22 holes images(from hole 10 hole 18) doesn't' become visible :o idea?

looks you're not reacting event when points.text changes. should subscribe event , perform check again. if condition met, can enable elements' visibility.

note: should use mvvm pattern provided microsoft platform, starting framework such caliburn micro

this kind of ui update not sustainable once application grow.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -