Use the panaroma control,
<Controls: panoramaitem foreground = " {Staticresource maintitle} " Header = " My account " > <Grid Height = " 650 " Margin = " 12, 0, 0, 0 " Verticalalignment = " Top " > <Grid X: Name = " Userhomelogined " Visibility = " Collapsed " > <Grid. rowdefinitions> <rowdefinition Height = " 150 " > </Rowdefinition> <rowdefinition Height = " * " > </Rowdefinition> </grid. rowdefinitions> <grid. Row = " 0 " > <Stackpanel orientation = " Horizontal " > <Image stretch = " None " Source = " /Image/userhome/uploadphoto.png " > </Image> <textblock margin = " 0, 12, 0, 0 " TEXT = " A user " > </Textblock> </stackpanel> </GRID> <ListBox X: Name = " Userhomemenu " Grid. Row = " 1 " > <Listboxitem> <stackpanel Height = " 40 " Orientation = " Horizontal " > <Image Source = " /Image/userhome/collection.png " > </Image> <textblock X: Name = " Accountremain " Tap = " Accountremain_tap " Margin = " 12, 0, 0, 0 " Foreground = " {Staticresource hubbackground} " TEXT = " My balance " > </Textblock> </stackpanel> </listboxitem> </ListBox> </GRID> <stackpanel X: Name = " Userhomeunlogin " Orientation = " Vertical " > <Textblock text = " Username/email/member account " > </Textblock> <textbox borderthickness = " 1 " Borderbrush = " Gray " Width = " 400 " Style = " {Staticresource textboxstyle1} " > </Textbox> <textblock text = " Password " > </Textblock> <textbox borderthickness = " 1 " Borderbrush = " Gray " Width = " 400 " Style = " {Staticresource textboxstyle1} " > </Textbox> <button X: Name = " Login " Click = " Login_click " Width = " 200 " Height = " 100 " Background = " {Staticresource hubbackground} " Content = " Login " Style = " {Staticresource buttonstyle1} " > </Button> " {Staticresource hubbackground} " Content = " If you do not have an account, click here to register " Name = " Register " /> </Stackpanel> </GRID> </controls: panoramaitem>
After the user clicks log onUserhomeunloginHide, SetUserhomelogined:
Userhomeunlogin. Visibility = system. Windows. Visibility. collapsed;
Userhomelogined. Visibility = system. Windows. Visibility. visible;
After dragging panaroma,Userhomeunlogin will flash and disappear,
Solution
Userhomeunlogin .. children. Clear (); userhomelogined. Visibility= System. Windows. Visibility. visible;