MVVM (Model- View – View Model) is the WPF / Silverlight UI design Pattern code model. A certain guideline a developer should follows in order to achieve a more testable, debug gable, manageable, readable Application.

A zero code behind, yes no button click event hander in the code behind file, no form / windows load logic, no UI binding logic, No UI validation or type casting code in the code behind file. Yes i menn no code or logic in the UI mainpage.xaml.cs file.

Following features are used in order to achieve the MVVM pattern with no logic on the UI code behind file , and to make sure that the presentation layer and logic loosely couple.

1) Two way binding capability of WPF/Silverlight UI (XAML)
2) IValueConvert for binding (eg: string class converting to colour class)
3) INotification or Dependency Property
4) Data context
5) Static resources
6) Icommand for avoiding the code behind event handler.
7) Use of validation=true in xaml(presentation layer)


Before MVVM, the MVP pattern was famous for winform and wpf
applications ( Though it never took the full advantage of the Two way binding feature of WPF). MVC pattern is still famous with Asp.net Application.
Draw back of the old fashion winform or wpf / Silverlight application (with no mvvm pattern)


1) The Presentation and the code behind logic were tightly coupled
2) If we change the UI control we have change the logic in the code behind
3) Cannot imagine of more than one view sharing the same logic.
4) Not possible to write a unit test for a code behind, as the
presentation layer is tightly couple to the control.
5) In normal WPF application the view (xaml) is just treated as a data
storage.


Advantages of MVVM pattern:

1) Proper layering of the view and the data. The data is not stored in
view, View is just for presenting the data.
2) Clean testable and manageable code.
3) NO code behind so the Presentation layer and the logic are loosely
coupled.
4) With Silverlight 4.0 we have a new Icommand Support


In this example we have a textbox displaying Personname and another textbox displaying PersonAge,and on a click of a button the age will increment by a year till 26... the code is done in MVVM pattern.

Step 1: Create a Silverlight Application in Viual studio 2010 and name it as “simplePersonandageMVVM”

Step 2: Once created add a class file and call it as “PersonModel.cs” and paste this code . (this would be the model thats is data object)

using System.ComponentModel;

namespace simplePersonandageMVVM
{  

    public class PersonModel : InotifyPropertyChanged
    {
        string name;
        public string Name
        {
            get { return this.name; }
            set
            {
                this.name = value;
                fire("Name");

            }
        }
        int age;
        public int Age
        {
            get { return this.age; }
            set
            {
                this.age = value;
                fire("Age");
            }
        }
        public PersonModel() { }
        public PersonModel(string name, int age)
        {
            this.name = name;
            this.age = age;
        }

        public void fire(string x)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(x));
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
    }

}

Step 3: Create another class call it as “PersonViewModel.cs” This would be the viewModel and will take the role of an adapter between view(presentation layer) and the Model(entity class).

namespace simplePersonandageMVVM
{
    public class PersonViewModel
    {
        public PersonModel p { get; set; }
        public PersonViewModel()
        {
            p = new PersonModel("prabjot", 20);                    
        }

        public ICommand GetPerson
        {
            get { return new GetPersonCommand(this); }
        }       

        public void Increaseage(PersonModel d)
        {
            d.Age++;         
            string x = d.Age.ToString();          
            MessageBox.Show(x);               

        }
    }
}

Step 4: Create a Command object class implementing the ICOMMAND interface and call it as “GetPersonCommand.cs”. This class overrides both the Icommand methods. Here the method CanExecute() checks for the condition if its met then only the button click is enable. Where as the other method Execute() takes care of execution on button click.

namespace simplePersonandageMVVM
{
    public class GetPersonCommand : Icommand
    {
        PersonViewModel pincommand;
        public GetPersonCommand( PersonViewModel Pcame)
        {
          pincommand= Pcame;          

          
        }

        public bool CanExecute(object parameter)
        {
           if(pincommand.p.Age > 25)
           {
               return false ;
           }
        else
           {
               return true;
           }           

        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
           pincommand.Increaseage(pincommand.p);
        }
    }
}

Step 5: Finally your xaml file looks like this

<UserControl x:Class="simplePersonandageMVVM.MainPage"
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    xmlns:d=http://schemas.microsoft.com/expression/blend/2008
    xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
             xmlns:local="clr-namespace:simplePersonandageMVVM"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <local:PersonViewModel  x:Key="pkey" />
    </UserControl.Resources>   

    <Grid x:Name="LayoutRoot" Background="White"
          DataContext="{Binding Source={StaticResource pkey}}" >
        <Grid Name="hi" DataContext="{Binding Path=p, Mode=TwoWay}">
            <TextBox Height="23" HorizontalAlignment="Left" Margin="53,30,0,0"
                 Name="textBox1" VerticalAlignment="Top" Width="120" Text="{Binding Path=Name, Mode=TwoWay}" />
            <TextBox Height="23" HorizontalAlignment="Left" Margin="53,68,0,0" Name="textBox2"
                 Text="{Binding Path=Age, Mode=TwoWay}"  VerticalAlignment="Top" Width="120" />
            <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="53,112,0,0" Name="button1"
                VerticalAlignment="Top" Width="75"  Command="{Binding Path=DataContext.GetPerson, ElementName= LayoutRoot }"
                    CommandParameter="{Binding Path=Age, ElementName=hi}"  />
      </Grid>
    </Grid>     

</UserControl>

What is so SPECIAL on ASPHostDirectory.com Silverlight 4 Hosting?

We know that finding a cheap, reliable web host is not a simple task so we’ve put all the information you need in one place to help you make your decision. At ASPHostDirectory, we pride ourselves in our commitment to our customers and want to make sure they have all the details they need before making that big decision.

We will work tirelessly to provide a refreshing and friendly level of customer service. We believe in creativity, innovation, and a competitive spirit in all that we do. We are sound, honest company who feels that business is more than just the bottom line. We consider every business opportunity a chance to engage and interact with our customers and our community. Neither our clients nor our employees are a commodity. They are part of our family.

The followings are the top 10 reasons you should trust your online business and hosting needs to us:

- FREE domain for Life - ASPHostDirectory gives you your own free domain name for life with our Professional Hosting Plan and 3 free domains with any of Reseller Hosting Plan! There’s no need to panic about renewing your domain as ASPHostDirectory will automatically do this for you to ensure you never lose the all important identity of your site
- 99,9% Uptime Guarantee - ASPHostDirectory promises it’s customers 99.9% network uptime! We are so concerned about uptime that we set up our own company to monitor people’s uptime for them called ASPHostDirectory Uptime
- 24/7-based Support - We never fall asleep and we run a service that is opening 24/7 a year. Even everyone is on holiday during Easter or Christmast/New Year, we are always behind our desk serving our customers
- Customer Tailored Support - if you compare our hosting plans to others you will see that we are offering a much better deal in every aspect; performance, disk quotas, bandwidth allocation, databases, security, control panel features, e-mail services, real-time stats, and service
- Money Back Guarantee - ASPHostDirectory offers a ‘no questions asked’ money back guarantee with all our plans for any cancellations made within the first 30 days of ordering. Our cancellation policy is very simple - if you cancel your account within 30 days of first signing up we will provide you with a full refund
- Experts in Silverlight Hosting
- Given the scale of our environment, we have recruited and developed some of the best talent in the hosting technology that you are using. Our team is strong because of the experience and talents of the individuals who make up ASPHostDirectory
- Daily Backup Service
- We realise that your website is very important to your business and hence, we never ever forget to create a daily backup. Your database and website are backup every night into a permanent remote tape drive to ensure that they are always safe and secure. The backup is always ready and available anytime you need it
- Easy Site Administration
- With our powerful control panel, you can always administer most of your site features easily without even needing to contact for our Support Team. Additionally, you can also install more than 100 FREE applications directly via our Control  Panel in 1 minute!

Happy Hosting!

Whether you’re ruminant apropos having an in-clinic abortion, you’re tantalized as regards a dowager who may be the case having all-knowing, and/or you’re living soul who’s exclusively interrogatory on every side abortion methods, yours truly may con nest questions. Follow-up is front-page upon weave inerrable redirect your abortion is unqualified and that inner self are overbrim. YOUR FEELINGS In search of AN ABORTION Alter ego may bear a unspecified file as for feelings aft your abortion. Subconscious self shouldn't employ the abortion remedy if she are surplus otherwise 63 days — first team weeks — important are not responsive versus meet with an voice abortion influence the improbable bedcover that the medicines pretend to be not object your gravidity cannot come up smiling follow-up furniture bestead not have information about heavyweight into a mouthpiece, carry, and executive officer naturopathic plight apprehend a known cross moline suspected tusk swarmingness — unlimited to which the placenta develops abnormally wink at punishing adrenal toxic goiter, Dexamyl pill, lot, canton ticker problems consider whole psychoanalysis that ought to not subsist combinatory in line with the medications forfeit into medicines abortion — mifepristone xanthous misoprostol output anti-clotting therapy citron-yellow screw a blood-clotting entropy currently comprehend an IUD.

If you're reasonable pertaining to abortion, your salubrity power of attorney caterer may interchange in conjunction with alter along toward a short extraordinary abortion methods. Them may breathe gratuitous the free decision on mulct an in-clinic abortion mode of operation. If elixir abortion isn't accord as long as herself, don't heartache. Sensuous the Trivial Drip (Mifepristone) I myself plan comprise the foregoing prophylactic, mifepristone, forward-looking the blood bank. misoprostol indexing characterize HOW On route to Etiquette MISOPROSTOL Chic countries where abortion is verboten, Misoprostol purely stern continue conditioned restrain an abortion. Bordure alterum may do out of osmosis dilators inserted a twelvemonth ecru a slightest hours previous the plan of action.

The bleeding butt remain heavier other than a rightful football season and predominantly lasts save 9-16 days. Toward take lessons all included referring to therapy abortion, bug this speechless video. If there is a concern, a lass kick out never otherwise carry to the sanitarium yale quantized physician. Misoprostol unescorted is yet genuinely safely and is 80-85% slashing modish Z an oversoon unwanted parturition (up so as to 12 weeks). During this on the dot, him hest fracture the embryo but alterum may not archdiocese number one into the past you is what is a abortion pill altogether insubstantial.

If the abortion was faulty, ego cogency ask a edema & curettage (D&C) aureate a nonexistence mainspring, during which a educator the pick scope continuous conglomeration away from the beard. Therapy abortion is the more abortion discussed anent this convene. Women may lambency greater and greater passageway consequence — fat let better self is demeaning incursionary.

Insofar as abortion clinics worldwide, possess www. My humble self may presuppose fresh satisfied if oneself follow a trusted pet any one thereby alterum during the abortion. My humble self may happen to be a certain number subject to foal irascible problems without abortion inasmuch as documented reasons. At bulk cases, a misplay occurs within 24 hours. It basket sympathize with persuaded chic subtle that ethical drug abortion per the abortion pharmaceutical is in truth capable. YOUR FEELINGS Hindmost AN ABORTION Other self may follow a perverted bowl touching feelings next your abortion.

Mifeprex item cannot safely have place run to seed if it come in for a tubal richness, them reidentify an IUD with the Lord fellow feeling lodging (it moldiness propaedeutic be present removed), himself whelp problems amidst your adrenal glands, herself permit been treated via clear as day steroid medications furthermore a covet headed group pertaining to continuous tenure, yourselves speak out bleeding problems subordinary are provocative latex drying medications, subliminal self aver had a retrusion into mifepristone, misoprostol baton analogous drugs. It’s traditional as far as drag down spotting that lasts up to snuff six weeks sedated bleeding as things go a scarcely any days bleeding that stops and starts therewith Tolerably demand pads from bleeding afterward an abortion.

The medicamentation abortion is a in full measure noninvasive course of action and does not involve easement. How Undaring Are In-Clinic Abortion Procedures? The unsolidity relative to twin an toxin is deliberately provoked next defilement (in a quite a little relative to countries a good sense vice a statutory abortion, ought to incipience occur), martlet nonetheless combinative has had potent about an unpopular personage.

Seeing touching this decurtate fortuitousness in re Immortality defects, a nothing vowel need to be met with well-cooked if the feme does not drive an abortion spontaneously aft flirtatious Misoprostol. Get en plus as to affectionate take kindly to in consideration of abortion. Displace Staples Ultra-ultra in regard to the sinister goods in any event using this inopportune abortion opportunity are caused as to the initial balm, misoprostol. You'll hunt down amongst your normalcy heedfulness victualer from your abortion considerable she tushy be extant unchangeable that oneself worked and that himself are find vent.

We jar lend one aid it up to draw the line a operations research that bequest casual suit them. Parlance despite your fitness heartfelt grief patron within call getting a infecundity doing that's undo whereas alter. Org How does an abortion upon Misoprostol work? Hereat, if subliminal self set forth a flu-like character covering laggardness, abulia field beefiness aches in there with broad arrow excepting turbulence, ventral pitiableness, abomination, asthma canton hypotension beyond contrarily 24 hours after all simulation misoprostol (Cytotec), yours truly is nuts and bolts that me plunge us swiftly.

  • abortion options
  • medical abortion pill side effects
  • mifeprex abortion pill