Showing posts with label WPF. Show all posts
Showing posts with label WPF. Show all posts

Thursday, December 09, 2010

Iterating through Generic List in C#

Recently I need to loop through a Generic list and bind the result to a Combobox. Here is how you can do this in C#

List<CCDSDateResult> list = new List<CCDSDateResult>();
for (int i = 0; i < e.Result.Count; i++)
    if (e.Result.ToList()[i].ccds_date.ToString().Length > 0)
        // Write your add item in the list
        list.Add(new CCDSDateResult(DateTime.Parse(e.Result.ToList()[i].ccds_date.ToString())));
// adding a empty record to the list
list.Insert(0, new CCDSDateResult());
this.OrderComboBox.ItemsSource = list.ToList();

Hope this is useful. Thumbs up

Silverlight: MessageBox with Title, OK, and Cancel Buttons

A message box is a dialog box that is used to display an alert or a message. A message box can have a title and multiple options such as Yes/No or  OK/Cancel. A message box can also have some input control to take input from a user.

The MessageBox class in WPF represents a modal message box dialog, which is defined in the System.Windows namespace. The Show static method of the MessageBox is the only method that is used to display a message box. The Show method returns a MessageBoxResult enumeration that has values OK, Cancel, Yes, and No. We can use MessageBoxResult to find out what button was clicked on a MessageBox and take an appropriate action.

The following code snippet creates a MessageBox with a message, a title, and two OK and Cancel buttons.

 MessageBoxResult result = MessageBox.Show("Are you sure you want to delete this Deposit?",
                                    "Delete", MessageBoxButton.OKCancel);
      if (result == MessageBoxResult.OK)
         // do if your result is OK
         // do if result is cancel

Hope this help Smile

Thursday, May 13, 2010

Configuring IIS for Silverlight Applications

Recently i want to deploy my Silverlight application Window 2003 Server. I have copied all the files and thought it will work as in development machine. But i am not able to run on Window 2003 server, so for that i need to configure my server to support silverlight.

Here is the URL that found helpful.

Monday, October 20, 2008

Microsoft .NET Framework 3.0 (Brief Overview)


What is the Microsoft .NET Framework 3.0?
The Microsoft .NET Framework 3.0 (formerly WinFX), is the new managed code programming model for Windows.

It combines the power of the .NET Framework 2.0 with four new technologies:
Windows Presentation Foundation (WPF),
Windows Communication Foundation (WCF),
Windows Workflow Foundation (WF), and
Windows CardSpace (WCS, formerly “InfoCard”).

Use the .NET Framework 3.0 today to build applications that have visually compelling user experiences, seamless communication across technology boundaries, the ability to support a wide range of business processes, and an easier way to manage your personal information online. This is the same great WinFX technology you know and love, now with a new name that identifies it for exactly what it is – the next version of Microsoft’s development framework.

What is Windows Communication Foundation ?
The Windows Communication Foundation (previously codenamed "Indigo") is Microsoft's unified framework for building
secure, reliable, transacted, and interoperable distributed applications.

What is Windows Presentation Foundation ?

Windows Presentation Foundation (WPF) is the next-generation presentation sub-system for Windows.

It provides developers and designers with a unified programming model for building rich Windows smart client user experiences that incorporate UI, media, and documents.

What is Windows Workflow Foundation?

Windows Workflow Foundation (WF) is the programming model, engine and tools for quickly building workflow enabled applications.

WF radically enhances a developer’s ability to model and support business processes.

Windows Workflow Foundation is a part of the .NET Framework 3.0 that enables developers to create workflow enabled applications. It consists of the following parts:

Activity Model:
Activities are the building blocks of workflow, think of them as a unit of work that needs to be executed.

Activities are easy to create, either from writing code or by composing them from other activities. Out of the box, there are a set of activities provided that mainly provide structure, such as parallel execution, if/else, call web service.

Workflow Designer:
This is the design surface that you see within Visual Studio, and it allows for the graphical composition of workflows, by placing activities within the workflow model.
One interesting feature of the designer is that it can be re-hosted within any Windows Forms application.

Workflow Runtime:
Our runtime is a light-weight and extensible engine that executes the activities which make up a workflow.

The runtime is hosted within any .NET process, enabling developers to bring workflow to anything from a Windows Forms application to an ASP.NET web site or a Windows Service.

Rules Engine:
Windows Workflow Foundation has a rules engine which enables declarative, rule-based development for workflows and any .NET application to use.

Windows Workflow Foundation will be released as part of the .NET Framework 3.0 which is part of the Windows Vista release. The .NET Framework 3.0 will be available for Windows XP as well as Windows Server 2003

What is Windows Card Space ?
Windows CardSpace enables users to provide their digital identities in a familiar, secure and easy way.

In the physical world we use business cards, credit cards and membership cards.

Online with CardSpace we use a variety of virtual cards to identify ourselves, each retrieving data from an identity provider. Don't struggle with usernames and passwords, just choose an information card!