Getting Started with the MVVM Pattern in Silverlight Applications

Getting Started with the MVVM Pattern in Silverlight Applications

With the increasing popularity of Silverlight as an application development framework the discussion of patterns has grown louder and louder. Fortunately the majority of developers building Silverlight applications have agreed on a pattern that fits well in the Silverlight world called Model-View-ViewModel (MVVM). The MVVM pattern allows applications to be divided up into separate layers that provide multiple benefits ranging from better code re-use to enhanced testing capabilities. This post will explain key concepts found in the MVVM pattern and attempt to present them in a way that is easy to understand. I’ll show some code along the way to demonstrate how the MVVM pattern can be used and provide a few alternatives when it comes to binding data. The code shown later in the post can be downloaded here.

Visualizing Sound

Visualizing Sound

Introduction

I always wanted to do some basic sound processing and to be able to visualize the sound, see what speech looks like as a frequency spread, or how music looks.

In order to that, several simple problems need to be solved: 

  • DirectX sound playback -> raw values
  • DirectX listen -> raw values
  • Values -> FFT
  • Graph of an FFT
  • Way to see how the FFT evolves over time.

FFT Guitar Tuner

FFT Guitar Tuner

Introduction

This article shows how to use a Fast Fourier Transform (FFT) algorithm to calculate the fundamental frequency of a captured audio sound. Also, we will see how to apply the algorithm to analyze live sound to build a simple guitar tuner: the code provides a solution to the problem of calculation of the fundamental frequency of the played pitch.

Tagged

Применение атрибутов в C#

Применение атрибутов в C#

«Атрибуты обеспечивают эффективный способ связывания метаданных или декларативной информации с кодом». Что же такое эти самые метаданные? В большинстве случаев, это просто дополнительная информация о классе, свойстве или методе, которая на работу класса, свойства или метода не влияет. Но вот внешние, по отношению к нему, объекты приложения эту информацию могут получать и как то обрабатывать. Одним из ярких примеров применения атрибутов может служить атрибут NonSerializedAttribute [4].

Tagged

The Diligent Geek

 

All XAML developers are well aware of INotifyPropertyChanged interface. This interface is key to the data binding. Every ViewModel class or ViewModelBase abstract class implements this interface. One of the biggest issue with it is that the PropertyChangedEventHandler delegate event argument, PropertyChangedEventArgs constructor accepts the property name as string value. This can introduce bug in your code because of “MAGIC STRINGS” , where by which if developer misspell the property name or you require to rename your property , then it should be done very carefully otherwise your data binding can go completely for a toss and you would go in circles to figure out what the issue is. Let me illustrate what I am talking about with the code snippet below.

Old way implementation
  1. publicclassCustomerViewModel : INotifyPropertyChanged
  2.     {
  3.         privatestring customerNameValue = String.Empty;
  4.         privatestring phoneNumberValue = String.Empty;
  5.  
  6.         public

View original post 749 more words

.NET Framework Class Library

.NET Framework Class Library

Библиотека классов .NET Framework представляет собой библиотеку классов, интерфейсов и типов значений, которые обеспечивают доступ к функциональным возможностям системы. Она составляет основу для создания приложений, компонентов и элементов управления .NET Framework. Пространства имен и их категории в библиотеке классов перечислены в следующей таблице и подробно описаны в данном справочном руководстве. (Обратите внимание, что в содержании пространства имен и категории упорядочены по частоте использования, и чаще всего используемые пространства имен перечислены в первую очередь. Данный список упорядочен по алфавиту, чтобы у пользователей был и другой способ поиска информации о библиотеке классов.)

Tagged ,