﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>CapableObjects Forums / ECO / General discussions  / OCL variables in ViewModels / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>CapableObjects Forums</description><link>http://www.capableobjects.com/apps/InstantForum414/</link><webMaster>forums@capableobjects.com</webMaster><lastBuildDate>Wed, 08 Feb 2012 22:32:33 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: OCL variables in ViewModels</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5428-4-1.aspx</link><description>&lt;FONT face=Arial&gt;For any ViewModelUserControl you are using there will be a property called ViewModel that returns a &lt;FONT size=2&gt;&lt;FONT size=2&gt;Eco.ViewModel.Runtime.ViewModel&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;And this class has a &lt;FONT size=2&gt;&lt;FONT size=2&gt;GetOclVariableValueFromName&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt; method that returns the IElement that represents the variable.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2 face=Consolas&gt;&lt;FONT size=2 face=Consolas&gt;&lt;FONT face=Arial&gt;Just go ctrl.ViewModel.GetOclVariableValueFromName("TheVar").AsObject=DateTime.Now&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Thu, 29 Jul 2010 11:07:59 GMT</pubDate><dc:creator>HansKarlsen</dc:creator></item><item><title>OCL variables in ViewModels</title><link>http://www.capableobjects.com/apps/InstantForum414/Topic5428-4-1.aspx</link><description>Hi!&lt;br&gt;How can i assign some TYPED (=not string) initial value to my ViewModel OCL-variable in a ViewModel?&lt;br&gt;&lt;br&gt;- I have a "CreatedAt: DateTime" attribute on my class. In a ViewModel, I use a vCreatedAt:DateTime variable, and should be initialize it some value, like Today, Now etc. The string value '1234-05-06' works fine, but this not the true, ideal solution. &lt;br&gt;&lt;br&gt;- What means the "UserData" column in the ViewModel editor?&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Sorry for my english, please.&lt;br&gt;Thanks -- Gabor&lt;br&gt;</description><pubDate>Wed, 28 Jul 2010 09:51:00 GMT</pubDate><dc:creator>gaborfejes</dc:creator></item></channel></rss>
