×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Declaring a List of strings propety in App.Xaml.cs

    Hi all

    I am trying to pass a List<string> between my pages but my attempts have not been successful.I tried to declare a static property in App.Xaml.cs, however I am getting this error

    "Cannot specify accessibility modifiers for both accessors of the property or indexer myApp.App.listobjectname"

    Here is my code :

    public static List<string> listobjectname { get ; set;}

    Why am I getting this error? I tried modiying the accessor to private,public etc but still the error persists.What am I doing wrong?

  2. #2
    Registered User
    Join Date
    Nov 2013
    Posts
    29

    Re: Declaring a List of strings propety in App.Xaml.cs

    could be a few things, please verify that:
    - your static property is defined within the app.xaml.cs class and not outside of the class declaration or inside of a method
    - you don't do anything like this public static List<string> listobjectname { protected get ; protected set;}

    also, if you use a class instead of string, make sure that that class is public as well

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    568

    Re: Declaring a List of strings propety in App.Xaml.cs


  4. #4
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: Declaring a List of strings propety in App.Xaml.cs

    Thank you all for replying.My apologies, I had written the declaration in the wrong place.Moving it to within the class definition solved it.

    Cheers!

Similar Threads

  1. LWUIT list scrolling is slow whenever list cells contain long strings
    By lordbritishix1982 in forum Mobile Java UI and User Experience
    Replies: 1
    Last Post: 2013-12-03, 18:08
  2. In Wp7, how to include the 1 xaml page content in another xaml page
    By Murugan india in forum Windows Phone General
    Replies: 7
    Last Post: 2013-10-18, 13:42
  3. Fonts work with hard coded strings but not Resource strings
    By maclondon in forum Windows Phone General
    Replies: 14
    Last Post: 2013-09-27, 12:49
  4. Selection list with two line strings
    By jinuthomas in forum Symbian User Interface
    Replies: 5
    Last Post: 2009-06-24, 09:22
  5. complete list of nokia user-agent strings
    By rajorshi in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2004-05-28, 06:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×