This project is read-only.
Project Description
WPF/Silverlight Tool for generating View(XAML) from ViewModel.

viewmakersample2.png

Features

  • generate XAML from ViewModel. (wmv)
  • edit view layout.(wmv)

How to use

  • WPF
    1. reference the ViewMaker.Core.dll.
    2. write View Model code.
    3. use ViewUtil.Show.
    4. edit layout.
View Model code.
    public class HelloWorld : ViewModel
    {
        public string Input { get; set; }
        public string Output
        {
            get { return output; }
            set { output = value; OnPropertyChanged("Output"); }
        }
        private string output;
        public ICommand ExecCommand { get { return CreateCommand(()=>Output = "Hello" + Input); } }
    }

Startup code.
    public partial class App : Application
    {
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            ViewUtil.Show(new HelloWorld());
        }
    }


generated view
wpfHelloworld.png
when right click on the window and select "Edit layout" , the Layout editor is displayed.
editlayout.png
  • Silverlight
    1. reference the SilverlightViewMaker.Core.dll.
    2. write View Model code.
    3. add the ContentControl on page.
    4. use ViewUtil.BuildContent.
    5. edit layout.
Page code.
<UserControl x:Class="SilverlightApplication1.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"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot" Background="White">
        <ContentControl Name="main" />
    </Grid>
</UserControl>

code behind code.
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            this.main.Content = ViewUtil.BuildContent(new HelloWorld());
        }
    }

generated view
silverlightHelloworld.png

Last edited Jan 21, 2012 at 9:00 AM by akihiroe, version 10