hdolder.com srl

  hdc Home | Contenido  | KO1  | Director | Direcciones | email
  BLOCKS - Ejemplo BO3

v112

 

 

 *** Documento en elaboración ***

Muestra otra versión de la mini-aplicación BLOCKS No-visual del Ejemplo BO2 en la que la configuración de la red de MBLOCKS se hace mediante código XAML.

El ejemplo utiliza el componente  BBLOCKSBoard para albergar y procesar una red de BLOCKS muy simple compuesta por dos instancias del BLOCK BTest1.

El codigo de XAML es:

<blocks:BBLOCKSBoard 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:blocks='clr-namespace:ob.gc;assembly=BLOCKS_WPF'
	>
	<blocks:BTest1
		x:Name="BTest1_1" 
		OutStr="{x:Null}" 
		/> 
	<blocks:BTest1 
		x:Name="BTest1_2" 
	InStr="{Binding ElementName=BTest1_1, 
		Path=OutStr, Mode=OneWay}"
		OutStr="{x:Null}" 
		/> 
</blocks:BBLOCKSBoard>

El codigo de la aplicacion es:

using System;
using ...
using ob.core;

namespace ob.gc
{
static class Program
{
	// The main entry point for the application.
	[STAThread]
	static void Main()
	{
		BTest1 bt1;
		BTest1 bt2;
		BBLOCKSBoard host1 = 
			(BBLOCKSBoard)obXAML.XAMLFileToObject(
			  @"C:\MP\Setup\BLOCKS\TestData\Ejemplo_BO3.xaml");
		bt1 = (BTest1)host1.FindName("BTest1_1");
		bt2 = (BTest1)host1.FindName("BTest1_2");

		bt1.InStr = ")(*&^%$#@!";
		String outS = bt2.OutStr;

	}
}}

El codigo del  BLOCK BTest1 se muestra en el Ejemplo BO2.

@to_do actualizar

 

  TBW The BLOCKS World

©2011 hdolder.com srl