Skip to main content

Posts

Showing posts from 2012

Windows Phone 8 - Application bar command binding MVVM

This is a short post in which i will explain how on Windows phone 8 to bind the application bar button or menu item, first this is only a fix for the  BindableApplicationbar  which supports windows phone 7 only, i just made it support windows 8 no features added or anything. i have uploaded the dll file here so it can be accessible easily here is the link to download http://sdrv.ms/RApUal now that you got the link lets check how we gonna use it you can refer to BinableApplicationbar  or check out the code here that i actually used in my app and i already read it there !  Add a reference to the BindableApplicationBar library here is the link again  http://sdrv.ms/RApUal Add XML namespace declaration in your page's XAML: xmlns : bar ="clr-namespace:BindableApplicationBar;assembly=BindableApplicationBar" Set Bindable.ApplicationBar property on your page code as in the snippet below: < phone : PhoneApplicationPage >     …     < bar : Bindable.App

Introduction to Architecture: What is architecture?

The pursue of a good understanding of architecture and specially software architecture has been really into my mind for the past few months, and furthermore i have searched the internet for concepts and definitions. only to help get the grasp of what i need to understand. and i found a really good site  http://www.codingthearchitecture.com/  it was amazingly simple and very easy in ways this guy defines architecture and inspired by his book which i gladly bought and this website i have decided to write something about it.   First thing i understood is that you need to understand that architecture in so many ways have the same concept over so many industries whether its software construction..etc and this whole article is totally applicable to any field architecture is applied to The word architecture has many different meanings, variations and conceptual definitions searching here and there through friends and internet people seem to have their have these definitions accus

Windows 8 – XAML/C# how to Add multi push pins to map control Bing maps

Greetings readers I promised you in my previous post that I am gonna go a little bit deeper in the Bing map control and I will should more advanced scenarios and one is push pins, Basically I am going to tell you how you can add push pin to your map and also how to dynamically populate those push pins using binding Refer to my previous article Using bing maps part one  for more details cause I am going build on it so if you ever feel that you don’t understand something just click the link and spend a few minutes reading it, I promise you it will prove worthy. First lets add a normal push pin to our map  < Grid Background = " {StaticResource ApplicationPageBackgroundThemeBrush} " > < bm : Map x:Name = " MyMap " Width = " 640 " Height = " 480 " Credentials = " {StaticResource BingMapsApiKey} " > < bm : Map.Children > < bm : Pushpin x:Name = "

Windows 8 RTM Using bing map control. How to use the map control in a metro (modern) style App

This is a briefing article on how to start using Bing map control using XAML & C#, to begin with you must first follow a set of instruction to get a license key for using Bing maps. Lets talk first about bing maps and the map control Bing map control is a part of the Bing SDK for windows 8 modern style apps About the SDK as Microsoft says : Bing Maps SDK for Metro style apps (RTM Beta)   combines the power of Windows 8 and   Bing Maps ™ to provide an enhanced mapping experience for modern style apps. Developers can use this Bing Maps control to incorporate the latest road maps and aerial views into a Windows 8 Metro style app. This SDK includes controls for apps built using JavaScript, as well as apps built using C#, C++, and Visual Basic, and requires a   Bing Maps Key   for a Windows Metro style app. (If you have an existing “Metro style apps (BETA)” key, it will still work until the evaluation period expires.) Now lets get started and here is the prerequisit

IOC Part 3 – Using Ninject

Open visual studio and click new Project and choose a console application and name it Ninject.Console you should have your solution like that Now lets get the Ninject, I prefer Nuget If you don’t have it installed get it from here http://nuget.codeplex.com/releases or you can search for it in the VS extensions Tools->Extension manager. Open Nuget by right clicking the reference folder in the solution and click manager nugget packages and then search for Ninject and click install Package see screen shot below Configuration part Depending on the type of you app you need to set the configuration cause they must take place at the starting of the app, and since we are in a console application then the most convenient place is the program.cs. there we must create our standard kernel which is the handler which does all the binding. Binding is the operation of registering a type to its interface “will be explained by code later” So for now we need to create a st

IOC Part 2 - Ninject How it works and how to use

Intro This article is a follow-up to its predecessor Introduction to IOC AKA IOC Part 1, basically I am have chosen a dependency injection container that I have been acquainted with for some time now and I will be going in deep on how it works and how we can use it in a real life application. First – Know Ninject It is a dependency injection container that is used to separate application parts to be more loosely coupled, highly maintainable and then weirs them back with each other flexibly, so in Short it does IOC “you can check the previous article if you need more of understanding on what IOC really is here is the link  http://mohammedezzatawad.blogspot.com/2012/08/ioc-inversion-of-control-principle.html ” Second – How it works So that’s a good and a very important thing you need to know before using any framework, how does it work and to be precise the question you need to ask yourself is what is going on under the hood?, well as most of the Dependency Injection conta

IOC Part 1 - Inversion of control Principle

IOC Inversion of control Principle Series Intro This is the first article of a series targeting the deep understanding of what it means to IOC mostly using dependency injection, this will a really extensive study to what goes underneath the usage of a framework, so basically it is going to exceed the high level usage of a frame work such as Unity or Ninject, This will concentrate more on what goes under the hood and how does it communicate through the pipelines, This Article is An introduction to IOC. Intro It’s an infinite and everlasting purpose for us problem solvers to seek development practices and development techniques to lower the cost and increase the productivity of the problem solving principle, however terms of productivity, complexity, extendibility, maintainability and development cycle  are not determined by how partitioned, abstracted or object implemented your application is. All these relay heavily on how these objects are coupled, integrated and manipu

RuntimeBinderException cannot resolver property in Unit Test in case of dynamic return.. Solved

This is an issue that i have face while doing tests for a dynamic return method, while it worked on the run, it did not work on the testing environment so it had to be a mocking return issue, i was returning a collection of anonymous types and it was, how ever  i have found the solution, to illustrate the issue here is what happened in samples. A sample test would normally fail cause of exception runtime binder exception   so the test simply check for a return of a function that returns a dynamic object and checks for its return, once run a run time binder exception   will be thrown in the Assert statement as the props cannot be resolved. The issue here is with anonymous types if you use ExpandoObject instead it should work fine with no problem. So replace the anonymous type with an expand object, check below