A WPF TabControl contains multiple items (TabItem), just like any tab control, and adding new tabs is quite easy. The following example shows a tab control with two tab items. However, when you try adding child controls to a TabItem you’ll notice that you can actually add one single child. The following XAML code yields…
Category: .NET
Silverlight and Moonlight
Microsoft has released today Silverlight 1.0 for Windows and Mac, a cross paltform, cross browser plug-in for building richer web applications. You can read more about the features on Scott Guthrie’s blog or visiting the official page. Due to a partnership, with Microsoft Novell will create a 100% compatible run-time for Linux, called Moonlight. It will run…
My CodeGuru Articles on LINQ
Recently CodeGuru published the last part of my introductory series of articles on LINQ. Here are the links to the articles: Introduction to LINQ, part 1: LINQ to objects Introduction to LINQ, part 2: LINQ to XML Introduction to LINQ, part 3: LINQ to SQL I hope you’ll enjoy and benefit from the reading.
Performance of LINQ Queries
When I delivered the LINQ presentation at the RONUA meeting in April, I was asked how does LINQ perform on big data sets. To answer that I decided to test LINQ to XML against a 100+MB file. I decided to extract three different sets of data from this XML file: 1 set representing about 0.5MB…
LINQ to SQL
LINQ to SQL is an API that allows querying relational databases. The samples in this post are based on the concepts of: Entity classes (which are instances of Entity Types). Such a class is a regular .NET class that is decorated with the attribute Table and its properties and fields with the attribute Column DataContext,…
LINQ Presentation and Demos Available for Download
On Saturday, April 22, I delivered a presentation on LINQ at a meeting of the RONUA community in Timisoara. The presentation was focused on sample codes for LINQ to Objects, LINQ to XML and LINQ to SQL. Today I uploaded on the site the presentation and demo programs so that you can download them. Here…
LINQ to XML
LINQ offers an API called LINQ to XML, formally known as XLinq, that provides support for working with XML. This API resides in the System.Xml.Linq namespace, and you need to add a reference to the assembly with the same name to be able to use it. If you installed the Orcas March CTP bits, the…
yield keyword and lazy evaluation in C#
yield is a new contextual keyword introduced to C# 2.0, vital for lazy evaluation and the performance of queries in LINQ. Being a contextual keyword means that yield can be used as a variable name in C# without any problem. When put before return it becomes a keyword. yield allows one enumerable class to be…
LINQ: declarative and functional syntax
In my last post about LINQ I shown you an example about how to use the language integrated query to select information about directories. In this post I’ll get more into the syntax and show you something about the functional querying style. My examples will focus on displaying information about UEFA Champions Leage winners. Thus,…
LINQ example: listing directories
LINQ is a valuable feature for database and XML programming, but not only. Basically, you can use LINQ with everything that returns an IEnumerable. Here is an example, when I want to list the directories of a parent directory, in alfabetical order, and grouped by the file attributes (first all that have only the flag…