2

コンパイラとランタイムはバインディングについて文句を言いませんが、AutoCompleteTextBox で Setter がヒットすることはありません。

<Controls:AutoCompleteTextBox   
    Items="{Binding Path=DropDownValues}"
    Width="200" 
    Grid.Column="1" 
    Height="30"
   Tag="{Binding}"
  />

 public partial class AutoCompleteTextBox
    {
        public static readonly DependencyProperty ItemsProperty =
            DependencyProperty.Register(
                "Items",
                typeof(ItemCollection),
                typeof(AutoCompleteTextBox),
                new PropertyMetadata(default(ItemCollection), OnItemsPropertyChanged));


       public ItemCollection Items
       {
           get
           {
               return (ItemCollection)GetValue(ItemsProperty);
           }
           set
           {
               SetValue(ItemsProperty, value); //doesn't get hit
           }
       }


//This is how i'm cheating since my Items is always null
        private void CanvasName_Loaded(object sender, RoutedEventArgs e)
        {
            object obj = this.Tag;

            if (obj != null)
            {
                CjisQueryAutoCompleteData at = obj as CjisQueryAutoCompleteData;
                if (at != null)
                {
                    //use the data...
                    PopDropDown(at.DropDownValues);
                }
            }
        }

       //....
    }
4

1 に答える 1