Silverlight Element To Element Binding

Wednesday, August 18, 2010

Asp.net translation

Tuesday, August 3, 2010



DownLoad Source Code

By Usama Wahab Khan

Computer users..... know about CARPAL TUNNEL SYNDROME‏

For everyone who works daily on a computer. The mistakes daily mouse and keyboard usage will result in Carpal Tunnel Syndrome ! Use the mouse and keyboard correctly . View below for the surgery of a patient suffering from Carpal Tunnel Syndrome followed by the RIGHT TECHNIQUES for usage....









Correct way to work on the Computer













Hand Exercises for Carpal Tunnel Syndrome :











KINDLY SEND THIS TO EVERYONE YOU DON'T WANT TO SUFFER FROM THIS!

Silverlight Drag and Drop TreeView

Wednesday, July 7, 2010



Update From Dataset ADO.Net

Sunday, July 4, 2010


he System.Data namespace consists mostly of the classes that constitute the ADO.NET architecture. The ADO.NET architecture enables you to build components that efficiently manage data from multiple data sources. In a disconnected scenario (such as the Internet), ADO.NET provides the tools to request, update, and reconcile data in multiple tier systems.

//Initialize Connection from database

SqlConnection cn = new SqlConnection("connectionString");

//add this Query command with connectionstring parameters to data adopter to get schema form database

SqlDataAdapter da = new SqlDataAdapter("Select * from tablename",cn);

// Dataset Object

DataSet ds = new DataSet();

//fill database schema to dataset

da.FillSchema(ds, SchemaType.Mapped);


DataRow dRow1 = ds.Tables["workers"].NewRow();

dRow1[1] = "Value1"; //textBox1.Text;

dRow1[2] ="Value2"; //textBox2.Text;

dRow1[3] ="Value3";///textBox3.Text;

dRow1[4] = "Value4";///textBox4.Text;

dRow1[5] = "Value5";//textBox5.Text;

ds.Tables["workers"].Rows.Add(dRow1);

SqlCommandBuilder builder = new SqlCommandBuilder(da);

da.Update(ds);

ds.AcceptChanges();

Thank Microsoft for Send me Lovely Gifts Thank

Thursday, July 1, 2010

Few Days ago Microsoft Pakistan send a gift hamper with lots writing pad and in the morning i get big gift pack for Microsoft USA THANK FOR GIFTS I LOVE THE I LOVE THE SHIRTS THANK YOU











flotable Window demo

Wednesday, June 30, 2010

In Silverlight beta Microsoft provide us a Control called Childwindow.


Childwindow it just like we use Midi form in Desktop Windows Application or child form in base form window or you can say that Multiple form in one page but when we use silver-light ChildWindow Control it disable the parent Form. thats mean`s you can not work on parent form before close child-windows and you can not open Multiple child window in parent page to use them like flotable Windows or panels.ChildWindow has to be the top-most element in the Xaml. thats why its always on top and disable all parent controls .silverlight provide us another control for popup its called Popup Control so i just add ChildWindow in Popup as Child and open and close the popup thats i got base and beautiful functionality Childwindow like Floating ,dialog and i can interact with parent form as well or open Multiple childwindows in one form


 



 



<UserControl x:Class="SilverlightFlotingChildWindow.MainPage"



xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"



xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"



xmlns:d="http://schemas.microsoft.com/expression/blend/2008"



xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"



mc:Ignorable="d" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"



>



<Canvas x:Name="LayoutRoot" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">



<Button Content="Window 1" Height="23" HorizontalAlignment="Left" Margin="59,270,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />



<Button Content="Window 2" Height="23" HorizontalAlignment="Left" Margin="140,270,0,0" Name="button2" VerticalAlignment="Top" Width="75" Click="button2_Click" />



<Button Content="Window 3" Height="23" HorizontalAlignment="Left" Margin="221,270,0,0" Name="button3" VerticalAlignment="Top" Width="75" Click="button3_Click" />


</Canvas>

</UserControl>



 



 



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;


namespace SilverlightFlotingChildWindow

{


public partial class MainPage : UserControl

{


public MainPage()

{



InitializeComponent();



}



 


private void button1_Click(object sender, RoutedEventArgs e)

{


ChildWindow flotwin =
new ChildWindow();flotwin.Title = "Blue Window";

 


System.Windows.Controls.Primitives.Popup popup =
new System.Windows.Controls.Primitives.Popup();

 



flotwin.MouseLeftButtonDown += (a, x) =>



{


this.LayoutRoot.Children.Remove(popup);

this.LayoutRoot.Children.Add(popup);


popup.IsOpen =
true;

};



 


flotwin.Content =
new StackPanel()

{


Background =
new SolidColorBrush(Colors.Blue),

Height = 300,



Width = 300



};



flotwin.Closing +=(ss,ee)=>



{


popup.IsOpen =
false;

};



popup.Child = flotwin;


popup.IsOpen =
true;

 



 



 



LayoutRoot.Children.Add(popup);



}


private void button2_Click(object sender, RoutedEventArgs e)

{


ChildWindow flotwin =
new ChildWindow();

flotwin.Title = "Orange Window";


System.Windows.Controls.Primitives.Popup popup =
new System.Windows.Controls.Primitives.Popup();

 



flotwin.MouseLeftButtonDown += (a, x) =>



{


this.LayoutRoot.Children.Remove(popup);

this.LayoutRoot.Children.Add(popup);


popup.IsOpen =
true;

};


flotwin.Content =
new StackPanel()

{


Background =
new SolidColorBrush(Colors.Orange),

Height = 300,



Width = 300



};



flotwin.Closing += (ss, ee) =>



{


popup.IsOpen =
false;

};



popup.Child = flotwin;


popup.IsOpen =
true;

LayoutRoot.Children.Add(popup);



}


private void button3_Click(object sender, RoutedEventArgs e)

{


ChildWindow flotwin =
new ChildWindow();

 


flotwin.Title =
"Purple Window";System.Windows.Controls.Primitives.Popup popup = new System.Windows.Controls.Primitives.Popup();

 



flotwin.MouseLeftButtonDown += (a, x) =>



{


this.LayoutRoot.Children.Remove(popup);

this.LayoutRoot.Children.Add(popup);


popup.IsOpen =
true;

};


flotwin.Content =
new StackPanel()

{


Background =
new SolidColorBrush(Colors.Purple),

Height = 300,



Width = 300



};



flotwin.Closing += (ss, ee) =>



{


popup.IsOpen =
false;

};



popup.Child = flotwin;


popup.IsOpen =
true;

LayoutRoot.Children.Add(popup);



}



}





Download Source Code