see the link
http://blogs.msdn.com/b/davrous/archive/2009/12/18/silverlight-4-tutorial-adding-avatar-support-to-the-wcf-ria-services-business-template.aspx
Sunday, April 28, 2013
Thursday, April 11, 2013
Check Network Connection in Silverlight
Copy and Paste the code below into your main page loading
--Constructor
this.Loaded += new RoutedEventHandler(LoginPage_Loaded);
#region Get Network Status
private void LoginPage_Loaded(object sender, RoutedEventArgs e)
{
GetNetworkStatus();
NetworkChange.NetworkAddressChanged += new
NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);
}
private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
{
GetNetworkStatus();
}
private void GetNetworkStatus()
{
_dataContext.Online = NetworkInterface.GetIsNetworkAvailable();
if (!_dataContext.Online)
{
//no internet connection
_dataContext.Message = "Internet connection is not available";
}
else
{
//Load All user Data.
_dataContext.LoadData();
}
}
#endregion
--Constructor
this.Loaded += new RoutedEventHandler(LoginPage_Loaded);
#region Get Network Status
private void LoginPage_Loaded(object sender, RoutedEventArgs e)
{
GetNetworkStatus();
NetworkChange.NetworkAddressChanged += new
NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);
}
private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
{
GetNetworkStatus();
}
private void GetNetworkStatus()
{
_dataContext.Online = NetworkInterface.GetIsNetworkAvailable();
if (!_dataContext.Online)
{
//no internet connection
_dataContext.Message = "Internet connection is not available";
}
else
{
//Load All user Data.
_dataContext.LoadData();
}
}
#endregion
Monday, April 8, 2013
Use Silverligth Validation Theme
Create new project and add textbox into your main page.Open your project in Blend,Or you can create your project in Blend.See the Following step.
Set validation into button press and Run your application.
Thanks.
Tuesday, April 2, 2013
How can i change WCF Service Binding
It is simple and easy way to change WCF service binding.Here i will discuss step by step following below.
Figure 2
At first open your WCF service project and Follow the image. i think image have to represent many think without say.Now below
Figure 1Figure 2
Figure 3
I think it will be help you.
Monday, April 1, 2013
Drag Drop between datagrid cells
If you’ve been searching the web for a good sample of how to drag and drop data from one DataGrid to another in Silverlight, you’ve probably found some great samples out there, showing “how easy” it can be by just surrounding your. In fact, if you do that, you can drag and drop data from one grid cell to the other. The problem is that most of these demos are about the visual aspect of drag and drop. But in the real world, there is more work to be done. Most of the samples that I found did not deal with how to save the data once it was dropped in the other grid.
The Firsr XAML Code
<sdk:DataGrid Grid.Row="1" x:Name="dg" ItemsSource="{Binding Data}" AutoGenerateColumns="False" IsReadOnly="True" >
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Header="Id" Binding="{Binding Id}" />
<sdk:DataGridTemplateColumn Header="FirstName" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" >
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text ="{Binding FirstName}"
MouseLeftButtonDown="TextBox_MouseLeftButtonDown"
MouseLeftButtonUp="TextBox_MouseLeftButtonUp"
MouseMove="TextBlock_MouseMove"/>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
<sdk:DataGridTemplateColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" >
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding LastName}" MouseLeftButtonDown="TextBox_MouseLeftButtonDown" MouseLeftButtonUp="TextBox_MouseLeftButtonUp"/>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
The C# Code
private void TextBox_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
dragText = string.Empty;
TextBlock tb = sender as TextBlock;
dragTextBox = tb;
dragText = tb.Text;
}
private void TextBox_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
TextBlock tb = sender as TextBlock;
dragTextBox.Text = tb.Text;
tb.Text = dragText;
}
private void TextBlock_MouseMove(object sender, MouseEventArgs e)
{
TextBlock tb = sender as TextBlock;
tb.Cursor = Cursors.Hand;
}
Thursday, March 28, 2013
Shohel' Profile
Md. Shohel Rana
Email Address: iamshohelrana@gmail.com
Objective
My career goals continue in software engineering, in team-lead and possibly management roles, but still with hands-on tasks. I am looking forward to join a progressive organization. I am Strong team builder and leader. I have high level of personal morals and integrity. I am Goal oriented, self-motivated and committed to the successful outcome of the project. I am willing to work hard and have a great desire to learn.
Summary
Since February
2009, have around 4 years plus of extensive hands on experience of designing,
developing and deploying n-tier based applications.
An experienced team player with excellent communication and interpersonal skills who has the ability to work independently under pressure can lead, motivate and influence others and can train and mentor subordinates.
I am working as
Senior Software Engineer at Next It Ltd, Banani, Dhaka .
I have graduated
in 2008 from the Rajshahi University of Computer Science and Engineering.
Skills
|
Languages
|
Microsoft C# .NET, Microsoft VB .NET, XAML, XML, UML, SQL, HTML, CSS.
|
|
Web based Development
|
Microsoft Silverlight, MVC, ASP .NET, Web Services, WCF Services using the Microsoft .NET platform, Java Script, JQuery
|
|
Frameworks
|
|
|
Databases
|
Microsoft SQL
Server 2000 & 2005 & 2008 & 2012
|
|
Tools
|
Microsoft Visual
Studio 2012, Microsoft Expression Blend 4, Team Foundation Server
|
|
Server
|
Microsoft Server
2008 & 2012
|
|
IIS
|
6.0,7.0
|
Experience
Next
It Ltd, Banani, Dhaka .
Senior Software
Engineer
(December 2010 –
To date)
Responsibilities
include team management, direct client communication and software development.
Union
Group, Gulshan-1, Dhaka .
Software Engineer
(June 2009 –
December 2010)
Projects
Composite
Knitwear ERP - Next IT Ltd
Role:
· Application
Developer
Tools:
· Microsoft
C# .NET, MVC, Silverlight, WCF, JQuery, Ajax, SQL Server 2008 & 2012,
· Crystal
Report and RDLC Report.
Details:
This is a web based system which is developed to manage
and integrate all internal process. We split this big system into following
modules.
· Yarn
Stock Management System: This application will allow the administration to Manage
Requisition, PO , Receive, Issue, Stock, Sales,
Return, Booking, Manage invoices.
· Laboratory
Management System: This application will provide buyer expected color with
more. This application will have many separate work flows such as Buyer Color
Receipt, Distribute color according to responsible, generate recipe for color
and finally submit color with buyer’s approval.
· Knitting
Management System: This application will allow many work flows such as
Knitting Order, Yarn Calculation, Fabric Calculation, Plan, Yarn Booking,
Prestock, Production, Yarn Lot mapping, Issue.
· Garments
Order Management System: This application will allow many work flows such
as Buyers Order, Yarn Calculation, Fabric Calculation, Plan, Yarn Booking,
Prestock, Production, Yarn Lot mapping, Issue, Country wise Time of Delivery
· Dyes
and Chemical Stock Management System: This application will allow the
administration to Manage Requisition, PO ,
Receive, Issue, Stock, Sales, Return, Booking,Manage invoices
· Unfinished
Fabric Stock Management System: After Knitting and before dyeing this
application mange the fabrics that is called raw fabric.
· Dyeing
Management System: This application will allow many work flows such as
Dyeing Order, Dyeing machine manage and their plan, Production.
· Admin
Module: This is a property with three access level
o
buyer Login
o
Responsible persons Login
o
Admin login
· Setup
Module: This will allow the Basic setup for many pages such as yarn type,
composition, yarn count, denier, quality, country, city, state, currency, gauge
etc.
Mobile
Inventory Management System (MIMS) – Union Group
Role:
· Application
Developer
Tools:
· Microsoft
C# .NET, ASP .NET 2.0, Web Services, Java Script, Ajax, SQL Server 2005.
· Crystal
Report.
Details:
Complete ecommerce shopping system with following features
· Administration
system to easily update all product details, prices, pictures, stock details
and other information online.
· Manage
Customer Accounts
· Manage
Wish list
· Customer
Reviews & Rating
· Manage
categories and products
· Manage
Product options and related products
· Advanced
pricing algorithms
· Order
and Invoice history
· Shopping
cart system to allow easy purchase of products
· Automatic
email notification of orders
· Full
checkout procedure
· Fast
and friendly quick search and advanced search features
· Reports
of site visits, pages viewed, most viewed products, most ordered products and
most viewed categories
www.cmplbd.com
– Union group
Role:
· Application
Developer
Tools:
· Microsoft
C# .NET, ASP .NET 2.0, Web Services, Java Script, Ajax, SQL Server 2005
· Crystal
Report
Details:
This is a web
based solution which is demonstrates own company information and purchase and
sales history.
www.uniongroup.com/
– Union group
Role:
· Application
Developer
Tools:
· Microsoft
C# .NET, ASP .NET 2.0, Web Services, Java Script, Ajax, SQL Server 2005.
Details:
This is a web based solution which
is demonstrates own company information.
Education
B.Sc., Computer
Science (Hons)
Year: 2009
Distinctions
· Workshop
on Algorithms Development held on 2006 authors Kaikobad (BUET)
· Workshop on web development using PHP authors Md. Mahabub alam (CSE, Rajshahi University ).
· Inter
Department Programming Contest (2007), position in second.
· Bandhan
R. U., A voluntary blood donor organization.
Interests
Photography, Aero
Modeling, Computer Gaming.
References
|
Md. Shoriful
Islam,
Technical
Manager,
Vivid
Technologies Ltd.
E-mail: shoriful.cse.ru@gmail.com
|
Md. Raihan
Morshed,
Senior Software
Engineer
E-mail:
morshed.raihan@gmail.com.
|
I certify that all information written on this curriculum vitae form is absolutely true and correct and that I have not intentionally withheld or fabricated any circumstances that would, if disclosed, affect my application. I understand that any misrepresentation or omission of fact on my part shall be sufficient for rejection of my job application or my dismissal if employed.
Md. Shohel Rana
Monday, March 25, 2013
Silverlight 5 Validation
The new Validation states for controls in Silverlight 5 sure look nice but there are a number of limitations. For starters, you can only invoke them through:
- An exception thrown by a bound property setter
- An exception thrown by a ValueConverter
You can't even use the new ValidationAttributes from System.ComponentModel.DataAnnotations. Well, actually you can but you'd have to this inside the setter:
[Range(18, int.MaxValue, ErrorMessage="Must be 18 or over")]
public int Age
{
get { return _age; }
set
{
Validator.ValidateProperty(value, new ValidationContext(this, null, null)
{
MemberName = "Age",
});
_age = value;
OnPropertyChanged("Age");
}
}
public int Age
{
get { return _age; }
set
{
Validator.ValidateProperty(value, new ValidationContext(this, null, null)
{
MemberName = "Age",
});
_age = value;
OnPropertyChanged("Age");
}
}
What's particularly tricky is to display the invalid state if the value is never changed by the user. For example, you have a name field that is required:
[Reguired(ErrorMessage="Name is required")]
public string NameThis is bound to a TextBox:
<TextBox Text="{Binding Name, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" x:Name="NameTextBox"/>
<Button Content="Save" x:Name="SaveButton" />The problem is, the user might click save without ever entering the a name. Oh no!
[Reguired(ErrorMessage="Name is required")]
public string NameThis is bound to a TextBox:
<TextBox Text="{Binding Name, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" x:Name="NameTextBox"/>
<Button Content="Save" x:Name="SaveButton" />The problem is, the user might click save without ever entering the a name. Oh no!
Sure, we can catch that in our code (using the Validator type again, for example). However, there's no easy way of forcing the control to display the error. The only way to achieve this is to force the binding to update programmatically, like so:
BindingExpression binding = NameTextBox.GetBindingExpression(TextBox.TextProperty);
binding.UpdateSource();Now, to get this working on any scale is going to require code-behind. Lots of code-behind. And everybody knows I hate this. The whole validation story at the moment isn't going to play at all well with Model-View-ViewModel (MVVM).
BindingExpression binding = NameTextBox.GetBindingExpression(TextBox.TextProperty);
binding.UpdateSource();Now, to get this working on any scale is going to require code-behind. Lots of code-behind. And everybody knows I hate this. The whole validation story at the moment isn't going to play at all well with Model-View-ViewModel (MVVM).
Re-introducing the ValidationScope
In this update - the ValidationScope class becomes much more important and has more to offer than just an attached properties/behavior.
It now becomes an integral part of your ViewModel. Let's walk through a scenario. Here we'll have a ViewModel that exposes a Person property of type Person:
// properties snipped down for brevity
public class Person
{
[Required(ErrorMessage= "Name is required")]
public string Name {}
[Required(ErrorMessage = "Salutation is required")]
public string Salutation {}
[Range(0, int.MaxValue, ErrorMessage = "Must be over 18")]
public int Age {}
}Nice and easy. Now the validation scope comes into play - we add an instance to our ViewModel because we'll access it via binding. To be honest, this could go almost anywhere you like provided it's accessible in a Binding (resources, in the Person class itself, anywhere you like!).
// properties snipped down for brevity
public class MainViewModel : INotifyPropertyChanged
{
public ObservableCollection<string> Salutations {}
public Person Person {}
public ValidationScope PersonValidationScope {}
}So there's our model and our ViewModel. Now for some view - our Xaml (again, simplified for brevity):
<StackPanel local:ValidationScope.ValidationScope="{Binding PersonValidationScope}">
<TextBox
Text="{Binding Person.Name, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
local:ValidationScope.ValidateBoundProperty="Text" />
<TextBox
Text="{Binding Person.Age, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
local:ValidationScope.ValidateBoundProperty="Text" />
<ComboBox
ItemsSource="{Binding Salutations}"
SelectedItem="{Binding Person.Salutation, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"
local:ValidationScope.ValidateBoundProperty="SelectedItem" />
<Button Content="Save" Click="SaveButtonClick" />
</StackPanel>And the code-behind:
//Note - I'd normally use Prism's DelegateCommand and commanding support to avoid this code-behind but don't want to muddy the example
private void SaveButtonClick(object sender, RoutedEventArgs e)
{
_personViewModel.Save();
}Finally, the Save method on the ViewModel
public void Save()
{
// This causes all registered bindings to be updated
PersonValidationScope.ValidateScope();
if (PersonValidationScope.IsValid())
{
// Save changes!
}
}
// properties snipped down for brevity
public class Person
{
[Required(ErrorMessage= "Name is required")]
public string Name {}
[Required(ErrorMessage = "Salutation is required")]
public string Salutation {}
[Range(0, int.MaxValue, ErrorMessage = "Must be over 18")]
public int Age {}
}Nice and easy. Now the validation scope comes into play - we add an instance to our ViewModel because we'll access it via binding. To be honest, this could go almost anywhere you like provided it's accessible in a Binding (resources, in the Person class itself, anywhere you like!).
// properties snipped down for brevity
public class MainViewModel : INotifyPropertyChanged
{
public ObservableCollection<string> Salutations {}
public Person Person {}
public ValidationScope PersonValidationScope {}
}So there's our model and our ViewModel. Now for some view - our Xaml (again, simplified for brevity):
<StackPanel local:ValidationScope.ValidationScope="{Binding PersonValidationScope}">
<TextBox
Text="{Binding Person.Name, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
local:ValidationScope.ValidateBoundProperty="Text" />
<TextBox
Text="{Binding Person.Age, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
local:ValidationScope.ValidateBoundProperty="Text" />
<ComboBox
ItemsSource="{Binding Salutations}"
SelectedItem="{Binding Person.Salutation, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"
local:ValidationScope.ValidateBoundProperty="SelectedItem" />
<Button Content="Save" Click="SaveButtonClick" />
</StackPanel>And the code-behind:
//Note - I'd normally use Prism's DelegateCommand and commanding support to avoid this code-behind but don't want to muddy the example
private void SaveButtonClick(object sender, RoutedEventArgs e)
{
_personViewModel.Save();
}Finally, the Save method on the ViewModel
public void Save()
{
// This causes all registered bindings to be updated
PersonValidationScope.ValidateScope();
if (PersonValidationScope.IsValid())
{
// Save changes!
}
}
How it all works
Whilst getting here took me a whole morning of confusion - it's actually quite straightforward.
First, we use an attached behavior to pass the FrameworkElement we want to be the conceptual 'validation scope' within the VisualTree to our actual ValidationScope instance:
<StackPanel local:ValidationScope.ValidationScope="{Binding PersonValidationScope}">Then we specify the property who is bound and might need a refresh for each control:
<TextBox local:ValidationScope.ValidateBoundProperty="Text" />
<ComboBox local:ValidationScope.ValidateBoundProperty="SelectedItem" />Sadly, this is really a violation of the DRY principle anyway but it does have the added advantage of having to opt in your Bindings to the ValidationScope. Finally, when we're ready, we tell the ValidationScope to update all the bindings:
PersonValidationScope.ValidateScope();This kicks the process into action with a crawl of the VisualTree inside the FrameworkElement registered as our scope (the StackPanel in this case) and hunts out any attached ValidateBoundProperty properties wired to controls. When it finds them it looks for the appropriate DependencyProperty
<StackPanel local:ValidationScope.ValidationScope="{Binding PersonValidationScope}">Then we specify the property who is bound and might need a refresh for each control:
<TextBox local:ValidationScope.ValidateBoundProperty="Text" />
<ComboBox local:ValidationScope.ValidateBoundProperty="SelectedItem" />Sadly, this is really a violation of the DRY principle anyway but it does have the added advantage of having to opt in your Bindings to the ValidationScope. Finally, when we're ready, we tell the ValidationScope to update all the bindings:
PersonValidationScope.ValidateScope();This kicks the process into action with a crawl of the VisualTree inside the FrameworkElement registered as our scope (the StackPanel in this case) and hunts out any attached ValidateBoundProperty properties wired to controls. When it finds them it looks for the appropriate DependencyProperty
The source
Get it here and remember, this may damage your health and your house is at risk if you use it as it is: Download Source (15 KB)Sunday, March 24, 2013
Digital Clock in Silverlight
Add class
public class DigitalClock : TextBox
{
System.Windows.Threading.DispatcherTimer _dgDispatcherTimer = new System.Windows.Threading.DispatcherTimer();
public DigitalClock()
: base()
{
this.DefaultStyleKey = typeof(DigitalClock);
this.IsReadOnly = true;
this.TextAlignment = TextAlignment.Center;
this.FontSize = 12;
this.TextWrapping = TextWrapping.NoWrap;
this.Loaded += new RoutedEventHandler(DigitalClock_Loaded);
}
void DigitalClock_Loaded(object sender, RoutedEventArgs e)
{
_dgDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1000); // 1000 Milliseconds
_dgDispatcherTimer.Tick += new EventHandler(Each_Tick);
_dgDispatcherTimer.Start();
}
public void Each_Tick(object o, EventArgs sender)
{
TextBlock DigitalClock = GetTemplateChild("DigitalClock") as TextBlock;
if (DigitalClock !=null)
DigitalClock.Text = DateTime.Now.ToString("hh") + " : " + string.Format("{0:00}", DateTime.Now.Minute) + " : " + string.Format("{0:00}", DateTime.Now.Second) + " " + DateTime.Now.ToString("tt");
}
}
Subscribe to:
Posts (Atom)






