#1 – Что такое WPF?

WPF (Windows Presentation Foundation) является .NET библиотекой классов, которая позволяет создавать графически насыщенные клиентские программы для Windows. WPF приложения могут быть запущены либо в виде отдельных программ или могут работать внутри веб-браузера (Silverlight).

WPF визуализирует графические элементы с использованием векторной 3D графики, независимо от разрешения экрана. WPF использует DirectX для визуализации графических элементов, что позволяет воспользоваться преимуществами аппаратного ускорения. Если аппаратное ускорение недоступно, WPF визуализирует элементы программно, а не аппаратно.

WPF заменяет Windows Forms в качестве среды программирования для создания клиентских приложений на Windows.

Оригинал: #1 What is WPF

13.07.2010

Полезные ссылки (11.07.2010)

.NET

  1. C# Fundamentals: The Joys and Pitfalls of Enums — First, a quick recap of enums for those who are brand new or less familiar with them. Basically, enums a great way to declare a variable of a type that can be one of a fixed set of values.
    If you didn’t use enums, you would probably set up a bunch of string or integer constants instead. String comparison is, of course, more expensive than numeric comparison (though, of course, integers are harder to interpret through their raw values)...
  2. Floating point numbers and string representations — I’ve recently been doing some work on the HealthVault SDK to improve the consistency of how it deals with floating-point numbers, and thought that the information would be of general interest...
  3. Unit Tests and LINQ Queries — It’s easy to test LINQ queries when the LINQ queries always execute entirely in memory – like with LINQ to objects or LINQ to XML. All you need to do is put some in-memory data together and pass it to code executing the query...
  4. Recursive Descent Parser using LINQ: The Augmented Backus-Naur Form Grammar — A grammar is a device to define syntax for a language. A grammar is made up of rules, sometimes called productions. Each rule defines a symbol, when can then be further used in other rules. Grammars are not hard to understand; most developers instinctively understand grammars when they see them. When you learn a new programming language, almost without thinking about it, you assemble some version of the grammar in your head...
  5. Working with Zip Files in .NET [Richard Lee] — Before getting started, I’ll introduce myself. My name is Richard Lee, and I’m a developer intern on the BCL for the summer. I’ve only been here for a few weeks, but it’s been great working here. The people, the environment, and my project are all great. Speaking of which, my project is to add general purpose .NET APIs for reading and writing Zip files, which we’re considering adding to the next version of the .NET Framework...
  6. Null Or Empty Coalescing — In my last blog post, I wrote about the proper way to check for empty enumerations and proposed an IsNullOrEmpty method for collections which sparked a lot of discussion...
  7. Testing Email Sending — Recently I learned a couple of interesting things related to sending emails. One doesn’t relate to .NET at all, so if you’re a developer and you want to easily be able to test whether or not emails are working correctly in your application without actually sending them and/or installing a real SMTP server on your machine, pay attention. You can grab the smtp4dev application from codeplex, which will listen for SMTP emails...

Читать полностью »

11.07.2010

Полезные ссылки (15.06.2010)

.NET

  1. LINQPad Has Replaced Snippet Compiler in my ToolBox — I have been using Snippet Compiler for a long time now to do little, quick spikes or to try something out. If I needed to see how an object worked and I didn’t want to open up the full blown Visual Studio, I’d open up Snippet Compiler. Now I have a new tool to replace Snippet Compiler: LINQPad...
  2. Sometimes an enum is not the best idea — In our application we are dealing with a limited, but slowly growing number of suppliers. In some parts of the code each one is treated differently, in others parts we only have to identify them. Their id which is also understood by the outer world, is a simple integer number...
  3. Conditional Attribute — One cute feature of C# 1.0 was the introduction of the Conditional attribute. When you apply the conditional attribute to a method, calls to this method are only included in the resulting code if the appropriate define is set...
  4. Checking For Empty Enumerations — This method accepts a generic enumeration and then proceeds to check if the enumeration is null or empty. Do you see the potential problem with this code? I’ll give you a hint, it’s this line...
  5. C#: System.Lazy and the Singleton Design Pattern — So we've all coded a Singleton at one time or another. It's a really simple pattern and can be a slightly more elegant alternative to global variables. Make no mistake, Singletons can be abused and are often over-used -- but occasionally you find a Singleton is the most elegant solution...
  6. C# 4.0/BCL 4 Series: C# 4 Named Parameters — This is part of a series. I really should have combined Named Parameters when I wrote about Optional Parameters last time since they are similar and go well together. Again, nothing thrilling here to speak about in C# 4...
  7. C# 4.0/BCL 4 Series: C# 4 Optional Parameters — This is part of a series. C# 4 allows you to declare optional parameters in methods, constructors, and indexers. A parameter is optional if it specifies a default value in its declaration...
  8. Caveats of C# 4.0 optional parameters — C# 4.0 includes lots of shiny new hammers for us to bang away at every new and existing development problem we face. One of the more interesting features is the concept of named and optional parameters...
  9. Linq To Dataset: Display the contents of several tables in a data control — In several cases, we will be required to work with data in different datasets, or on the same dataset but at different DataTables. In these cases, the power of Linq will help us solve the problem quickly and easily...

Читать полностью »

15.06.2010

Полезные ссылки (13.05.2010)

.NET

  1. Simplify, Shorten and Speed Up Your LINQ Statements with "Let" (blog.nitriq.com) — I've been writing a lot of LINQ statements lately while working on Nitriq and have come across a pretty cool LINQ keyword - "let". It allows you to specify an intermediate calculation that can be referenced multiple times else where in your LINQ statement, including the where and select clauses...
  2. Entity Framework 4.0 POCO Classes and Data Services — If you've flipped on the POCO (Plain Ol' CLR Objects) code generation T4 templates for Entity Framework to enable testing or just 'cuz you like the code better, you might find that you lack the ability to expose that same model via Data Services as OData (Open Data). If you surf to the feed, you'll likely see something like this...
  3. — ...C# 4.0/BCL 4 Series: Complex numeric type — Like BigInteger, the Complex struct is another specialized numeric type new to Framework 4.0 and is for representing complex numbers with real and imaginary components of type double. It also lives in the System.Numerics.dll assembly. To use Complex, instantiate the struct, specifying the real and imvar aginary value...
  4. C# 4.0/BCL 4 Series: BigInteger — Another new type in Framework 4.0 os the BigInteger specialized numeric type. It lives in the new System.Numerics namespace and lets you represent an arbitrarily large integer without any loss of precision...
  5. C# 4.0/BCL 4 Series: System.Tuple — I mentioned, in my last post, that I was using C# 4.0 In A Nutshell to better my C# 3 and to come up to speed with C# 4/BCL 4. Another cool thing in Framework 4.0 is the generic set of classes for holding a set of differently typed objects called tuples. Like the Func<> and Action<> delegates, tuples also take up to 8 parameters...
  6. Use Extension method to write cleaner code — This blog post will show you step by step to refactoring some code to be more readable (at least what I think). Patrik Lownedahl gave me some of the ideas when we where talking about making code much cleaner. The following is an simple application that will have a list of movies (Normal and Transfer). The task of the application is to calculate the total sum of each movie and also display the price of each movie...
  7. All the posts in LINQ series
  8. Exploring LINQ #3 — LINQ keeps amazing me in its power and beauty. So much that for each problem I have to solve (coding problem that is) I find myself wondering can this be done with LINQ, and how...

Читать полностью »

13.05.2010

Полезные ссылки (02.05.2010)

.NET

  1. Layering enumerators — Now that I've touched upon XmlReader and how it can be used to stream data while allowing clean layering at the same time, I want to touch on the layer-able interface by excellence in the .NET Framework: IEnumerable...
  2. Reactive Framework Getting your LINQ on — Last time in our exploration of the Reactive Framework, we built a random Observable event generator. Now that we have our data source, we can start working with it. In the past, we would have hooked up event handlers to the event delegate and imperatively interacted with the values passed in the sender and EventArgs. Of course, when we Thinq LINQ, we try to find simpler, more declarative models to represent our intent...
  3. C#: Adding Functionality to 3rd Party Libraries With Extension Methods — Ever have one of those third party libraries that you love but it's missing that one feature or one piece of syntactical candy that would make it so much more useful? This, I truly think, is one of the best uses of extension methods...
  4. LINQ and Aggregate function — LINQ also provides with itself important aggregate function. Aggregate function are function that are applied over a sequence like and return only one value like Average, count, sum, Maximum...

Читать полностью »

02.05.2010

Полезные ссылки (27.04.2010)

.NET

  1. Reactive Framework Building an IObservable Event Generator — In my last post, I mentioned a number of cases where you may want to use the Reactive Framework. For some upcoming presentations, I wanted to focus on a couple of these scenarios, particularly on how you can use the Reactive Framework (rX) to work with events from device sensors. You can often find these kind of sensors in a number of industries, including Robotics, automated manufacturing systems, Medical monitors, Telecom usage, and Live financial feeds. In order to demonstrate using rX in this environment, I needed to build a module that simulated generating a bunch of sample random events. Below is the module that I created...
  2. Reactive Framework Why bother — Now that LINQ has been out for a while, I’m starting to work on a new set of talks that are related to some of the new extensions to LINQ. Although LINQ to databases (SQL, Entity Framework, etc) are interesting, I’ve always been partial to the more generalized abstraction that is found in LINQ to Objects and XML. One of the most compelling expansions on the core LINQ concepts at this point is the Reactive Framework (rX)...
  3. Lambda’s for .NET made easy… — he purpose of my blog is to explain things for a Silverlight developer. One of the best things about Lambda's is that you not only use them in Silverlight but any project targeting .net 3.5 I’ve seen several blog post that use lambda expressions always assuming the audience is familiar with them. The purpose of this post is to make them simple and easily understood. Let’s begin with a definition...
  4. C#: LINQ vs foreach - Round 1. — So I was reading Peter Kellner's blog entry on Resharper 5.0 and its LINQ refactoring and thought that was very cool. But that raised a point I had always been curious about in my head -- which is a better choice: manual foreach loops or LINQ...
  5. Working with Joins in LINQ — While working with data most of the time we have to work with relation between different lists of data. Many a times we want to fetch data from both the list at once. This requires us to make different kind of joins between the lists of data. LINQ support different kinds of join...
  6. Leveraging the Power of Typed DataSets, IEnumerable<>, and LINQ — ...In my previous post, I extolled my love of typed DataSets in .NET because they are not only quick to design and update, but also very easy to understand. Essentially, if you can read an entity-relationship model (a la ERwin or a Visio database diagram) -- which I suspect nearly all developers can -- then you can discern quite a bit of information from a typed DataSet
  7. Using C# 4.0’s DynamicObject as a Stored Procedure Wrapper — Ignoring the fashion, I still make a lot of use of DALs – typically when inheriting a codebase with an established database schema which is full of tried and trusted stored procedures. In the DAL a collection of base classes have all the scaffolding, so the usual pattern is to create a wrapper class for each stored procedure, giving typesafe access to parameter values and output. DAL calls then looks like instantiate wrapper-populate parameters-execute call...
  8. So You'd Like to Send Some Email (Through Code) — Despite my misgivings, email is the cockroach of communication mediums: you just can't kill it. Email is the one method of online contact that almost everyone -- at least for that subset of "everyone" which includes people who can bear to touch a computer at all -- is guaranteed to have, and use. Yes, you can make a fairly compelling case that email is for old stupid people, but let's table that discussion for now...
  9. Every Binary Tree There Is — The other day I wrote a little algorithm that did some operation on binary trees. I wanted to test it. I whipped up a few little test cases and it seemed fine, but I wasn’t quite satisfied. I was pretty confident, but maybe there was some odd binary tree topology that I hadn’t considered which would cause a bug...
  10. C# Extension Methods - To Extend or Not To Extend... — I've been thinking a lot about extension methods lately, and I must admit I both love them and hate them. They are a lot like sugar, they taste so nice and sweet, but they'll rot your teeth if you eat them too much...

Читать полностью »

27.04.2010

Полезные ссылки (12.04.2010)

.NET

  1. The Evolution Of C# — The first release of C# (C# 1.0) was all about building a new language for managed code that appealed, mostly, to C++ and Java programmers...
  2. Precision and accuracy of DateTime — The DateTime struct represents dates as a 64 bit number that measures the number of “ticks” since a particular start date. Ten million ticks equals one second...
  3. The performance implications of IEnumerable vs. IQueryable — It all started innocently enough. I was implementing a "Older Posts/Newer Posts" feature for my new web site and was writing code like this...

Читать полностью »

12.04.2010

Полезные ссылки (04.03.2010)

.NET

  1. The Weekly Source Code 51 - Asynchronous Database Access and LINQ to SQL Fun — You can learn a lot by reading other people's source code. That's the idea behind this series, "The Weekly Source Code." You can certainly become a better programmer by writing code but I think good writers become better by reading as much as they can...
  2. Thou Shalt not Iterate! : Part 2 — Last time we saw some interesting initialization constructs possible with LINQ. Hope some of you have tried it out. If not, it’s never too late. LinqPad is a good friend in need...

Читать полностью »

03.04.2010