# .NET and More > Silverlight >  how i can pass data from class to page

## developer.hosny

hi 
please i need to know how i can pass data from class to page

i have MainPage and Page1 and Class1

MainPage Content Page1 
and i do some operation in Class1 after finished i want to do something in Page1 via Class1

i was tried this code and doesn't  work

Page1 p = Application.Current.RootVisual as Page1;

p.txt1.Text = "Done";

----------


## developer.hosny

I'm solved it 

    public class mycls
    {

        public void m(UserControl p)
        {
            var x = p as  friendspage;
            x.txt1.Visibility = Visibility.Collapsed;
        }

    }

----------

