Monday, 15 March 2010

Hide a radio button visibility once it is clicked for the whole project in C# for a Windows Phone 8 application -



Hide a radio button visibility once it is clicked for the whole project in C# for a Windows Phone 8 application -

i have code :

if (rb1.ischecked.value) { navigationservice.navigate(new uri("/enterque.xaml?chkd=" + rb1.ischecked, urikind.relative)); this.rb1.visibility = visibility.collapsed; }

when rb1 checked collapse visibility on coming page. when navigate same page 1 time again via mainpage 1 time again visible ??

is rb1.visibility having local scope ?

you can take 1 visibility variable in app.xaml.cs file n hold value state visibility in application.

declaration:

public static visibility radvisibility = visibility.collapsed;

use:

rb1.visibility = app.radvisibility;

declare in app.xaml.cs

public static visibility radvisibility = visibility.visible;

mainpage.cs:

if (rb1.ischecked.value) { app.radvisibility = visibility.collapsed; this.rb1.visibility = app.radvisibility; navigationservice.navigate(new uri("/enterque.xaml?chkd=" + rb1.ischecked,urikind.relative)); } protected override void onnavigatedto(navigationeventargs e) { this.rb1.visibility = app.radvisibility; }

c# windows windows-phone-8 navigation radio-button

No comments:

Post a Comment