Showing posts with label Windows Phone. Show all posts
Showing posts with label Windows Phone. Show all posts

Monday, August 26, 2013

Ho to use XML files In WinPhone

If we are storing static data in our Win Phone app, xml files can be used  for that.
Following sample explains how to do that:
<CountrList>
  <country name="Abkhazia" capital ="Sukhumi" />
  <country name="Afghanistan" capital ="Kabul" />
  <country name="Albania" capital ="Tirana"  />
</CountrList>


we can bind xml data to a list by using following code
<ListBox Name="lstData"
         ItemsSource="{Binding}"
         DisplayMemberPath="objMyList" />


public class clsWorldList
{
  public string MyName { get; set; }
  public string MyCapital { get; set; }
}
....
....
var xElem = XElement.Load("XML/List.xml");
  var objMyList =
      from elem in xElem.Descendants("country")
      orderby elem.Attribute("name").Value

      select new clsWorldList
       {
         MyName = elem.Attribute("name").Value,
         MyCapital = elem.Attribute("capital").Value,
       };

  lstData.DataContext = objMyList ;


Sunday, August 4, 2013

List of Images needed for WinPhone app

Here goes the list  of Images needed for WinPhone app:

Application Image's:
ApplicationIcon  (100x100)
FlipCycleTileSmall (159x159)
FlipCycleTileMedium (336x336)
FlipCycleTileLarge (691x336)
StoreTitle (300x300)
BackGroundImage (1000x800)

Show case  Image's:
480 x 800
720 x 1280
768 x 1280

Tuesday, April 9, 2013

Passng Data Between Pages in Windows Phone

•Can pass string data between pages using query strings
private void passParam_Click(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/SecondPage.xaml?msg=" + textBox1.Text, UriKind.Relative));
}
 
•On destination page
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
string querystringvalue = "";
if (NavigationContext.QueryString.TryGetValue("msg", out querystringvalue))
textBlock1.Text = querystringvalue;
}
 

 


Overriding the Back Key in Windows Phone


Here is the code to override the e Back Key in Windows Phone



<phone:PhoneApplicationPage

x:Class="PhoneApp1.MainPage"



shell:SystemTray.IsVisible="True"

BackKeyPress="PhoneApplicationPage_BackKeyPress">
In code:

private void PhoneApplicationPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)

{

e.Cancel = true; // Tell system we've handled it

// Hide the popup...

...

}

How to upload app to macOS

1. Open Terminal Press Cmd (⌘) + Space , type Terminal , and hit Enter . 2. Navigate to Your Build Output Directory Your .app file is likel...