ViewModel Views relation/link/syncroniztion

Posted by mehran on Stack Overflow See other posts from Stack Overflow or by mehran
Published on 2011-01-15T10:49:42Z Indexed on 2011/01/15 10:53 UTC
Read the original article Hit count: 259

Filed under:
|
|
|

Third try to describing problem:

I have some class for view models:

public class Node : INotifyPropertyChanged
    {
        Guid NodeId { get; set; }

        public string Name { get; set; }

    }

public class Connection: INotifyPropertyChanged
    {
        public Node StartNode { get; set; }
        public Node EndNode { get; set; }
    }

public class SettingsPackModel
{
        public List<Node> Nodes { get; private set; }
        public List<Connection> Connections { get; private set; }
}

I also have some templates to displays these models:

<DataTemplate DataType="{x:Type vm:Node}">…</DataTemplate>
<DataTemplate DataType="{x:Type vm:Connection}">
    <my:ConnectionElment StartNodeElment="???" EndNodeElment="???"> 
</my:ConnectionElment>
<DataTemplate>

But the problem is that DataTemplate for Connection need reference ot two element of type UIElement , how can I pass these two, how can I fill ??? in above expression?

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf