void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 22 "..\..\..\..\DataTable\Dialog\NewColumnDialog.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.CancelButton_Click);

            #line default
            #line hidden
                return;

            case 2:

            #line 23 "..\..\..\..\DataTable\Dialog\NewColumnDialog.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.OkButton_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.TypePresenter1 = ((System.Activities.Presentation.View.TypePresenter)(target));
                return;
            }
            this._contentLoaded = true;
        }
        static void OnMostRecentlyUsedTypesPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            TypePresenter ctrl = (TypePresenter)sender;

            ((ObservableCollection <Type>)args.NewValue).CollectionChanged += ctrl.OnMostRecentlyUsedTypesChanged;
            ((ObservableCollection <Type>)args.OldValue).CollectionChanged -= ctrl.OnMostRecentlyUsedTypesChanged;

            ctrl.OnItemsChanged();
        }
        static void OnFilterChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            TypePresenter ctrl = (TypePresenter)sender;

            if (null != ctrl.PropertyChanged)
            {
                ctrl.PropertyChanged(ctrl, new PropertyChangedEventArgs("Items"));
            }
        }
示例#4
0
 void TypeKeyDown(object sender, KeyEventArgs e)
 {
     if (TypePresenter.IsPreviewKey(e.Key))
     {
         ListViewItem typeView = (ListViewItem)sender;
         //always focus on the type presenter so the presenter could handle keyboard events
         TypePresenter typePresenter = FindChildElement <TypePresenter>(typeView);
         if (typePresenter != null)
         {
             typePresenter.Preview();
         }
         e.Handled = true;
     }
 }
        static void OnBrowseTypeDirectlyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            TypePresenter ctrl = (TypePresenter)sender;

            if (!(bool)args.NewValue)
            {
                ctrl.typeComboBox.Visibility  = Visibility.Visible;
                ctrl.typeTextBlock.Visibility = Visibility.Collapsed;
                ctrl.Focusable = false;
            }
            else
            {
                ctrl.typeComboBox.Visibility  = Visibility.Collapsed;
                ctrl.typeTextBlock.Visibility = Visibility.Visible;
                ctrl.Focusable = true;
            }
        }
        static void OnTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            TypePresenter ctrl = (TypePresenter)sender;

            ctrl.lastSelection = (Type)args.NewValue;

            if (null != ctrl.PropertyChanged)
            {
                ctrl.PropertyChanged(ctrl, new PropertyChangedEventArgs("TypeName"));
            }

            if (null == ctrl.lastSelection)
            {
                ctrl.typeComboBox.SelectedIndex = ctrl.typeComboBox.Items.IndexOf(ctrl.NullTypeWrapper);
            }

            ctrl.Text = ctrl.TypeName;
            ctrl.RaiseEvent(new RoutedEventArgs(TypePresenter.TypeChangedEvent, ctrl));
        }
 //ctor - initialzied with list of loaded types into the presenter
 internal TypeWrapperConverter(TypePresenter typePresenter)
 {
     this.typePresenter = typePresenter;
 }
        static void OnAllowNullChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            TypePresenter ctrl = (TypePresenter)sender;

            ctrl.OnItemsChanged();
        }
        static void OnContextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            TypePresenter ctrl = (TypePresenter)sender;

            ctrl.OnItemsChanged();
        }