Page 2 of 2

Re: NoesisGUI and Unity Integration

Posted: 25 Oct 2012, 22:32
by edgarhsanchez
Does..
xmlns:i="http://schemas.microsoft.com/expression ... eractivity"
xmlns:ei="http://schemas.microsoft.com/expression ... teractions"
namespaces work in NoesisGUI at this time? If not is there an equivalent or plans to support?

Re: NoesisGUI and Unity Integration

Posted: 26 Oct 2012, 16:53
by sfernandez
@edgarhsanchez: I suppose you are talking about using Blend Behavior and Action extensions. We implemented part of the base architecture to make them work, but currently only GoToStateAction is implemented.

A full implementation of this feature is not on our plans for NoesisGUI v1.0, but could be included in a future revision if most users have a demand for it.

In order to help you better, can you explain what exactly are you trying to do that it requires these extensions?

Thank for your collaboration.

Re: NoesisGUI and Unity Integration

Posted: 29 Oct 2012, 16:10
by edgarhsanchez
We use Interaction such as...
<i:Interaction.Triggers>
     <ei:DataTrigger Value="true" Binding="{Binding IsBlinking}">
         <m:ControlStoryboardAction Storyboard="{StaticResource BlinkingStoryboard}" />
     </ei:DataTrigger>
     <m:StoryboardCompletedTrigger Storyboard="{StaticResource BlinkingStoryboard}">
         <i:InvokeCommandAction Command="{Binding SomeCommand}" />
     </m:StoryboardCompletedTrigger>
     <i:EventTrigger EventName="Click">
         <i:InvokeCommandAction Command="ACommand"/>
     </i:EventTrigger>
</i:Interaction.Triggers>
to carry out specific animations or commands on events

Re: NoesisGUI and Unity Integration

Posted: 01 Nov 2012, 02:19
by sfernandez
@edgarhsanchez: We don't have implementations for all these extensions, but I'm almost sure that the xaml you presented can be translated to code that is already implemented.

For example, you can launch the BlinkingStoryboard when a property change event is raised for IsBlinking.
Then attach a handler for Completed event of that storyboard.
The handler will execute the SomeCommand command manually.
You can also attach another handler to Click event and execute the ACommand command manually.

If you need help to do it, just ask in the forums ;)

Re: NoesisGUI and Unity Integration

Posted: 06 Nov 2012, 06:59
by pmike
I'am try to import the last version of NoesisGUI (0.9.6) for Unity3D (version 3.5.4), but Unity says:
"Error while importing package: Package has unknown format".
Is package file correct?

Re: NoesisGUI and Unity Integration

Posted: 06 Nov 2012, 08:15
by dmrvar
Same with me!...3.5.5f2
"Error while importing package: Package has unknown format"

Re: NoesisGUI and Unity Integration

Posted: 06 Nov 2012, 13:26
by sfernandez
Sorry for the inconvenience. Yesterday we accidentally introduced a misconfiguration on the web server that lead to corrupt downloads of Unity packages. Now the problem is solved.

Please feel free to download again the package and try the new samples.

Thanks for your patience.

Re: NoesisGUI and Unity Integration

Posted: 09 Nov 2012, 15:39
by dmrvar
Thanks its working now.

My next questions are related to performance and data binding to real data object and using
this data in ItemsSource and DataContext...

1.Can you provide me working example how to use control.SetDataContext and control.SetItemsSource
who are using BaseComponent as parameter to bind c# data object


We have for example;
class Person
{
string name;
int age;
DateTime born;
}

so should we make something like that

class Person:DependencyObject
{
DependencyProperty name; //what type?
DependencyProperty age;// SWIGTYPE_p_int ?
DependencyProperty born;
}

binding:
Person person = new Person();
//initialize members
control.SetDataContext(person);

Collection items = new Collection();
items.Add(person1);
items.Add(person2);
....
control.SetItemsSource(items );

2. Do you plan to make any VirtualizingPanel?
For example:
I dynamically added 1000 Buttons to ScrollView->StackPanel.Items, only 20 visible on the screen
with ScrollView. Memory consumption in TaskManager was 2Gb.... :-( and very long loading time.

Is there any better performance when using DataTemplates and data binding..


I hope that you understand, what I am thinking about.

Re: NoesisGUI and Unity Integration

Posted: 12 Nov 2012, 18:57
by sfernandez
For question 1 we are still working on extensibility from Unity side. It is something that is working perfectly on the C++ side through the use of our reflection system. So the expectations are being able to use .NET reflection to obtain the necessary info for resolving bindings to Unity classes. When this is solved this process would be totally automatic.

Meanwhile you can populate your lists manually, creating the required elements for each item:
// Your data class
public struct Person
{
    public string name;
    public int age;
}

// ...

// Persons data
Person[] persons = new Person[] {
    new Person() { name = "John", age = 35 },
    new Person() { name = "Mike", age = 36 },
    new Person() { name = "Anne", age = 29 },
};
		
// List item generation
ListBox personsList = new ListBox();
personsList.SetHorizontalAlignment(HorizontalAlignment.Center);
personsList.SetVerticalAlignment(VerticalAlignment.Bottom);
personsList.SetMargin(new Thickness(20.0f));
ItemCollection items = personsList.GetItems();
		
foreach (Person person in persons)
{
    TextBlock name = new TextBlock(person.name);
    name.SetMinWidth(50.0f);
    TextBlock age = new TextBlock(person.age.ToString());
    age.SetMargin(new Thickness(10.0f, 0.0f, 0.0f, 0.0f));

    StackPanel personItem = new StackPanel();
    personItem.SetOrientation(Orientation.Horizontal);
    UIElementCollection children = personItem.GetChildren();

    children.Add(name);
    children.Add(age);

    items.Add(personItem);
}
For question 2 the answer is totally yes ;)
Not for version 1.0, because we are not focusing yet on optimizations. But it is planned to be included in version 1.1.