Using WECPOF in runtime

You can use WECPOF in design time ECO projects and in Gaffr.net files.

This article explains how to use it in runtime to deliver finished applications.

It starts out as an ordinary ECO project (create one from the wizard, Create new project Eco project).

You then create your model, update the code, configure your Persistence mapper of choice, set up any remote persistence mapper and synchronization if you want to just as the PDF-tutorials explain, Create or evolve your database, or derive the model from an existing database with the Reverse derive options.

Then add a WPF-Window or a WPF-Page (for browser applications).

Make sure your project references WECPOFLogic, then add a reference to the xaml :

xmlns:wecpof="clr-namespace:WECPOFLogic;assembly=WECPOFLogic"

And add a MainMenu and a WECPOFWindowEnvironment (this is where the WECPOF windows will be hosted)

Code Snippet

<Window x:Class="WpfApplication1.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
  xmlns:wecpof="clr-namespace:WECPOFLogic;assembly=WECPOFLogic"
  Title="Window1" Height="314" Width="354">
 <Window.Resources>
  <LinearGradientBrush x:Key="WECPOFWinBackgroundBrush" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#CCC" Offset="0.0" />
    <GradientStop Color="#EEE" Offset="1.0" />
  </LinearGradientBrush>
... cut for clarity...
  </Window.Resources>

 <Grid>
  <Grid.RowDefinitions>
   <RowDefinition Height="22"></RowDefinition>
   <RowDefinition></RowDefinition>
  </Grid.RowDefinitions>
  <Menu Grid.Row="0"  Name="MainMenu">
  </Menu>
  <wecpof:WECPOFWindowEnvironment x:Name="WecpofWinEnv">
  </wecpof:WECPOFWindowEnvironment>
 </Grid>
</Window>

In code behind we need to create our ecospace and hook everything up; this is boiler plate code:

Code Snippet

And you are done:

This page was edited 90 days ago on 02/10/2024. What links here