Silverlight Drag and Drop TreeView
Wednesday, July 7, 2010
Posted by Usama Wahab Khan at 12:02 AM 0 comments
Labels: Silverlight
Update From Dataset ADO.Net
Sunday, July 4, 2010
//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();
Posted by Usama Wahab Khan at 11:59 PM 0 comments
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
Posted by Usama Wahab Khan at 12:44 AM 1 comments
Labels: Usama wahab khana
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
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);
}
}
Posted by Usama Wahab Khan at 12:26 AM 2 comments
Entity Framework with Linq CRUD Operation Example
Friday, June 25, 2010
Posted by Usama Wahab Khan at 11:54 AM 2 comments
Labels: Asp.net, entityframework, linq, visual Studio 2010
Asp.net Server Side State Management
Wednesday, June 23, 2010
Application state is stored in an instance of the HttpApplicationState class. This class exposes a key-value dictionary of objects. Declaring Application Variable In Application_Start handler of your application's Global.asax Application["Message"] = "Welcome to Evolution Technologies "; Application["PageRequestCount"] = 0; Application.Lock(); Application["PageRequestCount"] = ((int)Application["PageRequestCount"])+1; Application.UnLock();.gif)
Session State:
>
Declaring a Session Variable
Posted by Usama Wahab Khan at 10:10 PM 0 comments
Three Days Multi-Touch Training Session At MIC
Friday, June 18, 2010
Microsoft Pakistan has arranged a technical training camp on Windows 7 Multi-Touch platform to develop application’s using WPF and Silverlight 4. Trainer: Introduction to Multi Touch 3-b Day – 2 2






Ali Khawaja
Principal Consultant at Microsoft![]()
Training Camp Outline
Day – 1Track # Description 1 2-a Introduction to WPF & Silverlight 4 2-b Introduction to WPF & Silverlight 4 Lab 3-a Multitouch (Basics of Windows 7 Multitouch and its APIs) Multitouch Lab 4-a Drag and Drop, Printing, and Multi-touch in Silverlight 4-b Drag and Drop, Printing, and Multi-touch in Silverlight Lab Track # Description 1-a WPF/Silverlight Validation, Binding, DataForm and DataGrid 1-b WPF/Silverlight Validation, Binding, DataForm and DataGrid Lab Implementing a Scenario using Multi Touch 3-a Ribbon (Different aspects of the Windows 7 Ribbon and how to incorporate the Windows 7 Ribbon into existing applications.) 3-b Ribbon Lab
Microsoft Also Arranged a contest on Multi-Touch Application Development and i won that and got dinar 100 and its Was such a great experience and Trainer was such help . I like to Thanks Microsoft Arranged this kinda event in Pakistan such a great effort by mic ,Noman Sohai,Jibran Jamsha,Talha Mahmood,Naveed bajwa and etl
and Special thank to Ali Khawaja visiting Pakistan
Posted by Usama Wahab Khan at 1:45 AM 1 comments
Labels: Silverlight, Usama wahab khana





