I have a Person class with a name property.
I have a custom activity that have this Person object as a dependency property.
Now when I drop this custom activity into the workflow designer. I can see the Person in the property grid.
From the designer I'd like to be able to specify the name of the person.
Is this possible? Or the only way is to really create a Name property in my Custom activity.
Since this is unanswered for ages now I'll add an answer because it might help someone.
From what I understand you have an object x stored in a property of control and you'd like to show a property of the object x.
An example could be a combobox which contains an array of person. But you don't want person to show in the combobox. You might want to show their names.
You can achieve that by setting DisplayMemberBinding="name".
Related
I have an element which is created as a table. In the "Element Properties" window, I see the Type is Class and Stereotype is table. For other similar tables, the Type is Table and Stereotype is table. Something seems to be icky with this particular instance.
However, when I run the following script
var element as EA.Element;
element = Repository.GetTreeSelectedObject();
Session.Output(element.Type);
The result is (for both tables!) Class. I thought to outsmart the EA UI by programmatically setting the type, but as both tables (the OK table and the "broken" table) both produce Class when asked for the .Type, I'm hesitant to set the .Type using a script.
I have thought about removing this table and re-adding a new one, but this is tedious as the table has a lot of connections.
How to change the Type of this particular "broken" table to "Table"?
The problem is that both «table» stereotypes are not the same.
The one where the type indicates Table is the correct one.
The other one is a rogue one.
Steps to solve this:
Remove the rogue stereotype from the internal stereotype list Configure | Reference Data | UML Types (to prevent the problem from happening again)
Change the stereotype from the problematic element to the stereotype «table» from the UML profile EAUML. In a script you can do this by setting the property EA.Element.StereotypeEx to the qualified name: EAUML::table). Manually you can use the [...] button to select the correct stereotype from the correct profile.
I'm currently trying to work out the best way to architect my realm objects for ease of retrieval.
I have 2 objects tags and object there are multiple tags and each one might contain many object. Similarly each object could have multiple tag associated with it
Ideally selecting a single tag should retrieve all object that have at least that one tag (but could obviously have multiple)
would my models be specified as
class Tag: Object {
let objects = List<Object>()
}
class Object {
let tags = List<Tag>()
}
I don't think I need to use an inverse relationship here or should I? Choosing a Category I should be able to just retrieve a list of all object references regardless, but then maintaining and updating the references to an object might be difficult here? I.e a user selects tag 'A' then updates the first object to also include tag 'B' I would need to update the object in the List for Tag A, then add a new item to the list for Tag 'B' and finally update the actual Object itself to include Tag 'B' in it's list of tags.
Just to be clear an Object will only ever display and allow editing of it's Tag objects. But the Tag object itself will need to know what Object's are applicable to it.
However it feels like I will have to do multiple updates when ideally I'd like to minimise this effort. Can anyone recommend a better way to do this? Or is there no way around this due to the limitations of Realm?
This is exactly what LinkingObjects is for. Changing the objects property in Tag to let objects = LinkingObjects(fromType: Object.self, property: "tags") will make it automatically update whenever a tag is added to an object.
I'm using DBIx::Class to model the following:
A Recipe with many Tags. The Tag is shared with other Recipe objects.
While creating a Recipe object I want to create a set of Tag objects and associate them with the newly created Recipe object. (The user enters a list of tags and I only have the name of the tag to go with)
For the Tags I could iterate over the list and find one that matches the user entered name or create a new object manually.
I couldn't find a documented findOrCreate type method in DBIx::Class. Any suggestions ?
If you have a key on the name you can use find_or_create.
If I have a property name in my class Project, is it possible to link that property to the property project_name in my class User?
I know that I can link a record to another record with a link, but I would like something similar between properties.
It is not possible since properties do not have an identity (physical position) like records, they are only values inside of records.
I'm using a DB First implementation of Entity Framework and I've run into an issue with a need for a computed column and the interaction with a view...
Scenario:
User has FirstName and LastName. In a listbox I want to use a display name generated from FirstName and LastName. Generally, simple enough. The issue comes from when either the first name or last name gets edited. I've extended my entities with INotifyPropertyChanged and implemented that in the T4 template. I extended the User entity to create a DisplayName property. In the View I use a CollectionViewSouorce based on the DisplayName.
The issue comes in when a user's name is edited, but no notification occurs because the change is made to either FirstName or LastName, not DisplayName. So the CollectionViewSource is never getting a change notification for DisplayName.
I could, manually, add an OnPropertyChanged("DisplayName") to the User entity in the FirstName and LastName properties, but that would be overwritten next time I update my model from the DB.
Any ideas on how to make this work?
Thanks.
J
I'd go for one of the following options:
create partial class User to your User entity with OnFirstNameChanged,OnLastNameChanged methods implemented in it, the class remains unchanged when you re-generate classes from model.
handle context.ObjectStateManager.ObjectStateManagerChanged event of your ObjectContext
http://msdn.microsoft.com/en-us/library/system.data.objects.objectstatemanager%28v=vs.100%29.aspx
adjust the t4 template(based on your question you know how to deal with it) to call custom method when FirstName and LastName property setter is generated.
For the record...
I went with a partial class extension and just programmatically triggered OnPropertyChanged for the DisplayName whenever the constituent properties were changed and saved.