Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6890729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:19:10+00:00 2026-05-27T06:19:10+00:00

I’m developing an app for WP7, but I ran into a problem I haven’t

  • 0

I’m developing an app for WP7, but I ran into a problem I haven’t seen before. When I build and run it in the emulator, it works as it should both in debug, and no-debug (ctrl-F5). But on the Windows device, it’s only working in debug (F5). When i run it on the device without debugging (ctrl-F5), the app starts, but when I get to a button-click, it just exit the app. In the button-click, I load an xml file. The xml file is set to Build Action “Content”, Copy to output “Do not copy”. Am I doing something wrong? I’m wondering if the following code in the xaml file beeing loaded has something to do with the error:

<phone:PhoneApplicationPage 
x:Class="appname.NamesList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:appname"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
shell:SystemTray.IsVisible="True">

<phone:PhoneApplicationPage.DataContext>
    <local:MainViewModel />
</phone:PhoneApplicationPage.DataContext>

<Grid x:Name="LayoutRoot"
      Background="Transparent">
    <toolkit:LongListSelector ItemsSource="{Binding Persons}">
        <toolkit:LongListSelector.GroupItemsPanel>
            <ItemsPanelTemplate>
                <toolkit:WrapPanel Orientation="Horizontal" />
            </ItemsPanelTemplate>
        </toolkit:LongListSelector.GroupItemsPanel>
        <toolkit:LongListSelector.GroupHeaderTemplate>
            <DataTemplate>
                <Border Background="Transparent">
                    <Border Width="75"
                            Height="75"
                            HorizontalAlignment="Left"
                            Background="{StaticResource PhoneAccentBrush}">
                        <TextBlock VerticalAlignment="Bottom"
                                   Foreground="{StaticResource PhoneForegroundBrush}"
                                   Style="{StaticResource PhoneTextExtraLargeStyle}"
                                   Text="{Binding Key}" />
                    </Border>
                </Border>
            </DataTemplate>
        </toolkit:LongListSelector.GroupHeaderTemplate>
        <toolkit:LongListSelector.GroupItemTemplate>
            <DataTemplate>
                <Border Width="75"
                        Height="75"
                        Background="{StaticResource PhoneAccentBrush}"
                        IsHitTestVisible="{Binding HasItems}">
                    <TextBlock VerticalAlignment="Bottom"
                               Margin="{StaticResource PhoneTouchTargetOverhang}"
                               FontFamily="{StaticResource PhoneFontFamilySemiBold}"
                               FontSize="{StaticResource PhoneFontSizeExtraLarge}"
                               Foreground="{StaticResource PhoneForegroundBrush}"
                               Text="{Binding Key}" />
                </Border>
            </DataTemplate>
        </toolkit:LongListSelector.GroupItemTemplate>
        <toolkit:LongListSelector.ItemTemplate>
            <DataTemplate>
                <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                    <HyperlinkButton Name="cmdName" 
                                     Content="{Binding Name}"
                                     Click="cmdName_Click"
                                     Margin="75,0,0,0" 
                                     HorizontalAlignment="Left"
                                     FontSize="40" />
                </Grid>
            </DataTemplate>
        </toolkit:LongListSelector.ItemTemplate>
    </toolkit:LongListSelector>

</Grid>

And the MainViewModel:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using appname.Helpers;

namespace appname
{
    public class MainViewModel
    {
        public MainViewModel()
        {
            App app = Application.Current as App;

            XmlHelper xmlHelper = new XmlHelper();
            app.persons = xmlHelper.GetPersons(app.gender);
            List<Person> persons = app.persons;


            this.Persons = new LongListCollection<Person,char>(persons, person => person.Name[0]);
        }

        public LongListCollection<Person, char> Persons
        {
            get;
            private set;
        }
    }
}

Edit
The code for the xml file-reading:

 public List<Person> GetPersons(string gender)
    {
        string xmlPath = "";
        if (gender == "Boys")
            xmlPath = @"Resources/Boys/Xml/Names.xml";
        else if( gender == "Girls" )
            xmlPath = @"Resources/Girls/Xml/Names.xml";

        //Uri uri = new Uri(xmlPath, UriKind.Relative);
        StreamResourceInfo sm = Application.GetResourceStream(new Uri(xmlPath, UriKind.Relative));
        System.Xml.XmlReader xr = System.Xml.XmlReader.Create(sm.Stream);

        XDocument data = XDocument.Load(xr);



        return (from c in data.Descendants("Person")
                orderby c.Attribute("Name")
                select new Person()
                {
                    Name = c.Element("Name").Value,
                    Description = c.Element("Description").Value,
                    ...
                    HasGraph = c.Element("HasGraph").Value
                }).ToList();
    }

Edit

<Capabilities>
  <Capability Name="ID_CAP_GAMERSERVICES"/>
  <Capability Name="ID_CAP_IDENTITY_DEVICE"/>
  <Capability Name="ID_CAP_IDENTITY_USER"/>
  <Capability Name="ID_CAP_LOCATION"/>
  <Capability Name="ID_CAP_MEDIALIB"/>
  <Capability Name="ID_CAP_MICROPHONE"/>
  <Capability Name="ID_CAP_NETWORKING"/>
  <Capability Name="ID_CAP_PHONEDIALER"/>
  <Capability Name="ID_CAP_PUSH_NOTIFICATION"/>
  <Capability Name="ID_CAP_SENSORS"/>
  <Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/>
  <Capability Name="ID_CAP_ISV_CAMERA"/>
  <Capability Name="ID_CAP_CONTACTS"/>
  <Capability Name="ID_CAP_APPOINTMENTS"/>
</Capabilities>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:19:11+00:00Added an answer on May 27, 2026 at 6:19 am

    Oh my god

    I tried starting another app on my phone, and it exited also. So, I rebooted the phone (thought I had done this yesterday..), and it works! I’m sorry for wasting your time!

    Regards an embarrased fool!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
We're building an app, our first using Rails 3, and we're having to build
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.