windows phone 8 - ScrollViewer's scrolling control by coding in xaml.cs -


in windows phone app, try control scrolling of scrollviewer.in requirements wants scroll page when variable value bla blaa. way resolve type of thing? please let me know .

  <grid x:name="contentpanel2" grid.row="2" margin="12,0,12,0">         <scrollviewer margin="-10,0,10,169">             <stackpanel height="916">                 <textbox x:name="txtnomecliente" height="auto" textwrapping="wrap"                         text="" background="white" borderbrush="white" isreadonly="true"/>                 <button x:name="botaocatalogo" content="catálogo"                     width="auto" height="80" verticalalignment="top" background="#ff3faaca" borderbrush="#ff3faaca" />                 <button x:name="botaoitens" content="itens"                     width="auto" height="80" verticalalignment="top" background="#ff3faaca" borderbrush="#ff3faaca"/>                 <grid background="#ff0f3b48" margin="12,0,12,0">                     <grid.columndefinitions>                         <columndefinition width="*"/>                         <columndefinition width="*"/>                     </grid.columndefinitions>                     <stackpanel grid.column="0"                         verticalalignment="center"                         orientation="horizontal"                         margin="5">                         <textblock text="qtde. de itens:"                              fontsize="{staticresource phonefontsizemedium}"/>                         <textblock x:name="lblquantidadeprodutos" text="0" margin="10,0,0,0" fontsize="{staticresource phonefontsizemedium}" width="43"/>                     </stackpanel>                     <stackpanel grid.column="1"                         verticalalignment="center"                         horizontalalignment="right"                         orientation="horizontal"                         margin="2">                          <textblock x:name="lblvalortotal" fontsize="{staticresource phonefontsizemedium}"/>                      </stackpanel>                 </grid>                 <button x:name="botaopagamentos" content="adicionar pagamento"                     width="auto" height="80" verticalalignment="top" background="#ff3faaca" borderbrush="#ff3faaca"/>                 <listbox x:name="listapagamentos" itemssource="{binding listapagamentos}"/>                 <listbox x:name="listaentrega" itemssource="{binding listaentrega}"/>                 <grid background="#ff0f3b48" margin="12,0,12,0">                     <grid.columndefinitions>                         <columndefinition width="*"/>                         <columndefinition width="*"/>                     </grid.columndefinitions>                     <stackpanel grid.column="0"                         verticalalignment="center"                         margin="5">                         <textblock                              fontsize="16" fontweight="bold">                             <run fontweight="normal" text="forma de pagamento: vista"/>                         </textblock>                         <textblock                              fontsize="16">                             <run text="parcela(s):"/>                             <run text=" "/>                             <run text="1"/>                         </textblock>                         <textblock                              fontsize="16">                             <run text="vencimento"/>                             <run text=":"/>                             <run text=" "/>                             <run text="25/05/2013"/>                         </textblock>                     </stackpanel>                     <stackpanel grid.column="1"                         verticalalignment="center"                         horizontalalignment="right"                         margin="2">                         <textblock                              fontsize="{staticresource phonefontsizemedium}" margin="0">                             <run text="    "/>                             <run text="valor"/>                         </textblock>                         <textblock text="r$ 399,00"                              fontsize="{staticresource phonefontsizemedium}"/>                     </stackpanel>                 </grid>                  <button x:name="cmdentrega" content="entrega" width="auto" height="80" verticalalignment="top" background="#ff3faaca" borderbrush="#ff3faaca" />                  <grid background="#ff0f3b48" margin="12,0,12,0" height="50">                     <grid.columndefinitions>                         <columndefinition width="5*"/>                         <columndefinition width="4*"/>                     </grid.columndefinitions>                     <stackpanel grid.column="0"                         verticalalignment="center"                         orientation="horizontal"                         margin="5,12,81,0" height="38" grid.columnspan="2">                         <textblock x:name="lbltransportadora"                              fontsize="{staticresource phonefontsizemedium}" width="149">                             <run fontsize="20" text="transportadora"/>                             <run fontsize="20" text=":"/>                         </textblock>                     </stackpanel>                 </grid>                 <grid height="13" width="437"/>                 <grid background="#ff0f3b48" margin="12,0,12,0" height="135">                     <grid.columndefinitions>                         <columndefinition width="5*"/>                         <columndefinition width="4*"/>                     </grid.columndefinitions>                     <stackpanel grid.column="0"                         verticalalignment="center"                         orientation="horizontal"                         margin="5,12,81,0" height="38" grid.columnspan="2">                         <textblock x:name="lbltransportadora1"                              fontsize="{staticresource phonefontsizemedium}" width="58" margin="0,-2,0,12">                             <run fontsize="20" text="rua:"/>                         </textblock>                     </stackpanel>                     <textblock fontsize="{staticresource phonefontsizemedium}" margin="5,11,128,85">                         <run fontsize="20" text="descrição:"/>                     </textblock>                     <textblock fontsize="{staticresource phonefontsizemedium}" margin="5,96,165,10">                         <run fontsize="20" text="cidade:"/>                     </textblock>                     <textblock x:name="lbldescricao" grid.columnspan="2" horizontalalignment="left" height="26" margin="113,16,0,0" textwrapping="wrap" verticalalignment="top" width="315"/>                     <textblock x:name="lblrua" grid.columnspan="2" horizontalalignment="left" height="26" margin="113,57,0,0" textwrapping="wrap" verticalalignment="top" width="317"/>                     <textblock x:name="lblcidade" grid.columnspan="2" horizontalalignment="left" height="26" margin="113,99,0,0" textwrapping="wrap" verticalalignment="top" width="319"/>                 </grid>                 <grid height="20" width="437"/>                 <textblock text="informações adicionais:" margin="15,10,0,0"/>                 <textbox x:name="txtinfoadicional" height="auto" textwrapping="wrap"                         text="{binding infoadicional, mode=twoway}" background="white" borderbrush="white"/>                 <button x:name="botaofinalizar" content="salvar orçamento"                     width="238" height="80" verticalalignment="top"                     horizontalalignment="right" borderbrush="#ff3faaca" background="#ff3faaca"/>             </stackpanel>         </scrollviewer>     </grid> 

thanks in advance

to arbitrarily scroll scrollviewer, use scrollviewer.scrolltoverticaloffset:

// scrolls down 10 pixels scrollviewer.scrolltoverticaloffset(10); 

edit: need change xaml to:

<scrollviewer x:name="scrollviewer"> 

to make accessible code behind.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -