Click here to Skip to main content
15,885,216 members
Articles / Desktop Programming / WPF

MVVM made easy with Calcium - Part 1

Rate me:
Please Sign up or sign in to vote.
4.97/5 (39 votes)
18 Apr 2010BSD21 min read 122.5K   1.6K   109  
Learn how to create a simple MVVM pattern based application using the Calcium SDK.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CalciumSample.ImageDesigner
{
    /// <summary>
    /// Interaction logic for ImageDesignerMenu.xaml
    /// </summary>
    public partial class ImageDesignerMenu : UserControl
    {
        public ImageDesignerMenu()
        {
            InitializeComponent();
        }
        		public IEnumerable<FrameworkElement> RetrieveAndDetachItems()
		{
			var list = new List<FrameworkElement>();
			foreach (var item in CustomMenu.Items)
			{
				list.Add((FrameworkElement)item);
			}
			foreach (var item in list)
			{
				CustomMenu.Items.Remove(item);
			}
			return list;
		}
	
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License


Written By
Product Manager Outcoder
United States United States
Katka has several years of experience working in software development in the areas of market research and e-commerce. She has wide ranging experience in developing Java, ASP.Net MVC, ASP.Net, WPF, Silverlight, and Windows Phone applications.

Company: Outcoder.com
Group: XAML Experts
Proud co-creator of: Surfy browser, Airlock Browser

Comments and Discussions