locked
set property another page

    Question

  • hi

    i want set select index listview another page or active click event button another page 

    how can do it?

    tanx


    Amir Ameri

    Thursday, December 04, 2014 7:56 PM

Answers

  • hi

    i have a class like this:

    public class SelectProfile
        {
            private int _numberofindex;
           public int numberofindex
           {
               get
               {
                   return _numberofindex;
               }
               set
               {
                   if (value>=-1&&value<=12)
                   {
                       _numberofindex = value;
                   }
               }
           }

    i set class value in page one(main page):

                    

    {
                SelectProfile idx = new SelectProfile();

                if (this.Frame != null)
                {
                    idx.numberofindex = 1;
                    this.Frame.Navigate(typeof(StahlbauProfileWS.ShapePage));

                }
            }

    i want get this value in page 2 when page2(shape page) is loading and do something :

     public ShapePage()
            {
                this.InitializeComponent();
               
                 IPEpage();
            }

            private void IPEpage()
            {
                SelectProfile idx = new SelectProfile();
               if ( idx.numberofindex = 1)
                {
                    lvIPE_Tapped(this, new TappedRoutedEventArgs());
                }
            }

    but this code not work for me. idx.numberofindex not return 1 that i set in page 1

    what is wrong?


    Amir Ameri


    • Edited by AMIR ameri Friday, December 05, 2014 2:27 PM
    • Marked as answer by AMIR ameri Sunday, December 07, 2014 7:11 PM
    Friday, December 05, 2014 2:25 PM

All replies

  • What are you exactly want? Can you explain more details.
    Friday, December 05, 2014 1:46 PM
  • hi

    i have a class like this:

    public class SelectProfile
        {
            private int _numberofindex;
           public int numberofindex
           {
               get
               {
                   return _numberofindex;
               }
               set
               {
                   if (value>=-1&&value<=12)
                   {
                       _numberofindex = value;
                   }
               }
           }

    i set class value in page one(main page):

                    

    {
                SelectProfile idx = new SelectProfile();

                if (this.Frame != null)
                {
                    idx.numberofindex = 1;
                    this.Frame.Navigate(typeof(StahlbauProfileWS.ShapePage));

                }
            }

    i want get this value in page 2 when page2(shape page) is loading and do something :

     public ShapePage()
            {
                this.InitializeComponent();
               
                 IPEpage();
            }

            private void IPEpage()
            {
                SelectProfile idx = new SelectProfile();
               if ( idx.numberofindex = 1)
                {
                    lvIPE_Tapped(this, new TappedRoutedEventArgs());
                }
            }

    but this code not work for me. idx.numberofindex not return 1 that i set in page 1

    what is wrong?


    Amir Ameri


    • Edited by AMIR ameri Friday, December 05, 2014 2:27 PM
    • Marked as answer by AMIR ameri Sunday, December 07, 2014 7:11 PM
    Friday, December 05, 2014 2:25 PM
  • hi

    i used static class and solve my problem.

    tanx


    Amir Ameri

    Sunday, December 07, 2014 7:11 PM