Be careful what you LINQ for: Mixing LINQ to SQL with LINQ to Entities

28 בMay 2014

An exception I encountered today, led me to pay more attention about the differences between LINQ to SQL and LINQ to Entities. Here is what I learned; Imagine your in a school, and the students council has announced the winners in the school's yearly programming competition. We have a bunch of students, and the winners names. Let's get all the winning student, that's easy: using (var db = new School()) { //Create students list var students = new List<Student> { new Student { ID =...
no comments

Facebook’s Hack Programming Language, Quick Introduction

19 בMay 2014

A few days ago, Facebook has announced the release of Hack, a PHP based programming language as an open source project. Let’s take a look into the new kid in the block. What will be hack’s market share? PHP is used in leading content management systems like Drupal and WordPress, Facebook's website is PHP based along with 240 million other websites (about 39% out of all) . It takes 3.3% of the programming language market, and much more relevant, 80% of server side programming language, giving Hack a large market \ user base potential. The Compiler Hack is a PHP based programming language...
tags: , ,
one comment

WPF – Binding ListBox SelectedItems – Attached Property VS Style

2 בMay 2014

It seems List Box doesn’t support SelectedItems property Binding. Well since my application does support multiple items selection, I went looking for a solution. What I found was the following: Support Multiple Selection Using Style Add the following style in the listbox’s XAML: <ListBox.ItemContainerStyle>                               <Style TargetType="{x:Type ListBoxItem}">                                   <Setter Property="IsSelected" Value="{Binding Mode=TwoWay, Path=IsSelected}"/>                               </Style>                           </ListBox.ItemContainerStyle> Add support for the styling in the view model: We have to support the style by wrapping the original AnimalType class. publicclassAnimalTypeForView       {           publicbool IsSelected { get; set; }           publicAnimalType Type { get; set; }       }       publicList<AnimalType> AnimalTypes       {           get { return AnimalTypes; }           set           {               _AnimalTypes =value;               NotifyOfPropertyChange(() => _AnimalTypes);           }       } I don’t like that, since it adds noise and mess to the view model code and it...

Create A Visual Studio Template Project With Refrenced Nugget

1 בMay 2014

I was repeating the task of creating a MVVM application, mostly to test complicated XAML scenarios in an isolated environment outside my real application, and thought it would be easier to use a VS template project for that. In order to use a template project, you need to export your project and pack it as a VS extension, with a special treat to referenced nuggets. 1. Download VS SDK. Will open the ability to create a VS extension project. 2. Create a VS Extension. Straight forward steps to export and pack as an extension. 3. Handle Nuggets. If you project contains Nuggets, you need to...
no comments