vc2010 class diagram: impossible to see a association with observable collection

Locked vc2010 class diagram: impossible to see a association with observable collection

  • 2 กรกฎาคม 2553 1:00
     
     

    hi,

    i develop a class A which own an observable collection of B.

    when i put A and B in a class diagram it s fine.

    if now i try to select the observable collection field and selects "see as association" or "see as collection association" then i get an error saying that the class does not exist! but everything is fine and compile ....

     

    any idea?

ตอบทั้งหมด

  • 2 กรกฎาคม 2553 7:48
    ผู้ดูแล
     
     คำตอบ

    Hi hophophop,

    I have a test as you mentioned, I can't reporduce the issue, I suggest you close the vs2010 and start it again. Here is my code:

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Linq;

    using System.Text;

    using System.Windows.Forms;

    using System.Collections.ObjectModel;

     

    namespace WindowsFormsApplication1

    {

        public partial class Form1 : Form

        {

            NameList a;

     

            public Form1()

            {

                InitializeComponent();

     

                NameList a = new NameList();

               

               

            }

        }

     

        public class NameList : ObservableCollection<PersonName>

        {

            public NameList()

                : base()

            {

                Add(new PersonName("Willa", "Cather"));

                Add(new PersonName("Isak", "Dinesen"));

                Add(new PersonName("Victor", "Hugo"));

                Add(new PersonName("Jules", "Verne"));

            }

        }

     

        public class PersonName

        {

            private string firstName;

            private string lastName;

     

            public PersonName(string first, string last)

            {

                this.firstName = first;

                this.lastName = last;

            }

     

            public string FirstName

            {

                get { return firstName; }

                set { firstName = value; }

            }

     

            public string LastName

            {

                get { return lastName; }

                set { lastName = value; }

            }

        }

     

    }

     

    If reset still can't solve it, I suggest you have a test about my application to check whether it can reproduce.

     

    Best regards,
    Guang-Ming Bian - MSFT
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help