Exemplo n.º 1
0
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            HeiBoyin h = new HeiBoyin();

            if (value is string)
            {
                h.Name = value as string;
            }
            return(h);
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Person person = this.FindResource("Lover") as Person;

            MessageBox.Show(person.Friend.Name);

            HeiBoyin heiMen = this.FindResource("hier") as HeiBoyin;

            MessageBox.Show(heiMen.Chield.Name);
        }