Skip to content

Instantly share code, notes, and snippets.

View wtuts's full-sized avatar

Windows App Tutorials wtuts

View GitHub Profile
@wtuts
wtuts / file1.xaml
Created June 26, 2014 14:24
Isolated Storage
<Button Content="Save single object data" HorizontalAlignment="Left" Margin="30,23,0,0" VerticalAlignment="Top" Width="392" Click="Save_single_object_button_click"/>
<Button Content="Read single object data" HorizontalAlignment="Left" Margin="30,114,0,0" VerticalAlignment="Top" Width="392" Click="Read_single_object_button_click"/>
<Button Content="Save composite object data" HorizontalAlignment="Left" Margin="42,256,0,0" VerticalAlignment="Top" Width="380" Click="Save_composite_object_button_click"/>
<Button Content="Read composite object data" HorizontalAlignment="Left" Margin="42,348,0,0" VerticalAlignment="Top" Width="380" Click="Read_composite_object_click"/>
<TextBlock x:Name="Displayblock" HorizontalAlignment="Left" Margin="42,496,0,0" TextWrapping="Wrap" Text="Display data Textblock" VerticalAlignment="Top" Height="101" Width="380" FontSize="26"/>
@wtuts
wtuts / file3.cs
Created June 26, 2014 18:56
Isolated Storage
//For single object data such as string
private void Save_single_object_button_click(object sender, RoutedEventArgs e)
{
//Declare the instance of Isolated Storage settings
var settings = IsolatedStorageSettings.ApplicationSettings;
//add a key value pair with key name and value chetan
settings.Add("name", "Chetan");
@wtuts
wtuts / file4.cs
Created June 26, 2014 18:57
Isolated Storage
//Sample class for composite object
public class Resultclass
{
public string name { get; set; }
public int marks { get; set; }
}
@wtuts
wtuts / file5.cs
Created June 26, 2014 18:57
Isolated Storage
private void Save_composite_object_button_click(object sender, RoutedEventArgs e)
{
//Data object to be saved
Resultclass obj = new Resultclass();
obj.name = "Vivek";
obj.marks = 98;
//Declare the instance of Isolated Storage settings
var settings = IsolatedStorageSettings.ApplicationSettings;
@wtuts
wtuts / file6.cs
Created June 26, 2014 18:59
Isolated storage
//For single object data such as string
private void Save_single_object_button_click(object sender, RoutedEventArgs e)
{
//Declare the instance of Isolated Storage settings
var settings = IsolatedStorageSettings.ApplicationSettings;
if (!settings.Contains("name"))
{
//add a key value pair with key name and value chetan
@wtuts
wtuts / file7.cs
Created June 26, 2014 18:59
Isolated Storage
using System.IO.IsolatedStorage;
@wtuts
wtuts / file8.cs
Created June 26, 2014 19:00
Isolated Storage
//Declare the instance of Isolated Storage settings
var settings = IsolatedStorageSettings.ApplicationSettings;
@wtuts
wtuts / file8.cs
Created June 26, 2014 19:01
Isolated Storage
var settings = Windows.Storage.ApplicationData.Current.LocalSettings;
@wtuts
wtuts / setlock.xaml
Last active August 29, 2015 14:03
set lock xaml
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel>
<CheckBox Name="applock" Foreground="Black" Background="WhiteSmoke" Content="App Lock" Checked="applock_Checked"/>
<TextBox Name="old_pin" Visibility="Collapsed" InputScope="Number" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="1" Height="84" KeyUp="txt_KeyUp"/>
<StackPanel Name="setpw" Visibility="Collapsed">
<TextBox Name="pin" InputScope="Number" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="1" Height="84" KeyUp="txt_KeyUp"/>
<TextBox Name="confirm_pin" InputScope="Number" Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="1" Height="84" KeyUp="txt_KeyUp"/>
</StackPanel>
</StackPanel>
@wtuts
wtuts / toogle.cs
Created June 27, 2014 17:15
toggle switch check status change
private void RadToggleSwitch_CheckedChanged(object sender, Telerik.Windows.Controls.CheckedChangedEventArgs e)
{
Telerik.Windows.Controls.RadToggleSwitch swtch = (Telerik.Windows.Controls.RadToggleSwitch)sender;
if (swtch.IsChecked == true)
{
if (App.islocked)
{
old_pin.Visibility = Visibility.Visible;
setpw.Visibility = Visibility.Visible;
}