passing data from one xaml to second xaml
Main.xaml
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 System.IO.IsolatedStorage;
namespace SilverlightApplication2
{
public partial class MainPage : UserControl
{
IsolatedStorageSettings ar = IsolatedStorageSettings.Applic ationSettings;
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
string y = "Maneesh";
ar["temp"] = y;
this.Content=new second();
}
}
}
Second.xaml
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 System.IO.IsolatedStorage;
namespace SilverlightApplication2
{
public partial class second : UserControl
{
IsolatedStorageSettings ar = IsolatedStorageSettings.Applic ationSettings;
public second()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(ar["temp"].ToS tring());
}
}
}
Main.xaml
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 System.IO.IsolatedStorage;
namespace SilverlightApplication2
{
public partial class MainPage : UserControl
{
IsolatedStorageSettings ar = IsolatedStorageSettings.Applic
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
string y = "Maneesh";
ar["temp"] = y;
this.Content=new second();
}
}
}
Second.xaml
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 System.IO.IsolatedStorage;
namespace SilverlightApplication2
{
public partial class second : UserControl
{
IsolatedStorageSettings ar = IsolatedStorageSettings.Applic
public second()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(ar["temp"].ToS
}
}
}
No comments:
Post a Comment