void AssociatedObject_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            ListBoxItem connectionItem = ControlTreeHelper.FindAncestorOfType <ListBoxItem>(AssociatedObject);

            if (connectionItem == null)
            {
                return;
            }

            Connection connectionToDelete = connectionItem.DataContext as Connection;

            if (connectionToDelete == null)
            {
                return;
            }

            ConnectionsDropDownPopupControl connectivityControl = ControlTreeHelper.FindAncestorOfType <ConnectionsDropDownPopupControl>(AssociatedObject);

            if (connectivityControl == null)
            {
                return;
            }

            connectivityControl.DeleteConnection(connectionToDelete);

            e.Handled = true;
        }
Пример #2
0
        void AssociatedObject_ColorPicked(object sender, ColorChosenEventArgs e)
        {
            ControlTreeHelper helper = new ControlTreeHelper();
            Popup             popup  = helper.FindParentControl <Popup>(AssociatedObject);

            if (popup == null)
            {
                return;
            }

            DropDownButton dropDownButton = popup.Tag as DropDownButton;

            if (dropDownButton == null)
            {
                return;
            }

            MapTipsConfig mapTipsConfig = helper.FindAncestorOfType <MapTipsConfig>(dropDownButton);

            if (mapTipsConfig != null)
            {
                mapTipsConfig.MapTipBorder = new SolidColorBrush(e.Color);
            }

            dropDownButton.ClosePopup();
        }
        void AssociatedObject_Clicked(object sender, RoutedEventArgs e)
        {
            MapTipsLayerConfig mapTipsConfig = ControlTreeHelper.FindAncestorOfType <MapTipsLayerConfig>(AssociatedObject);

            if (mapTipsConfig != null)
            {
                if (AssociatedObject.IsChecked.Value)
                {
                    mapTipsConfig.FieldInfo_MapTipVisiblityChecked(this.AssociatedObject.DataContext as FieldInfo);
                }
                else
                {
                    mapTipsConfig.FieldInfo_MapTipVisibilityUnChecked(this.AssociatedObject.DataContext as FieldInfo);
                }
            }
        }
Пример #4
0
        void AssociatedObject_Clicked(object sender, RoutedEventArgs e)
        {
            AttributeDisplayConfig mapTipsConfig = ControlTreeHelper.FindAncestorOfType <AttributeDisplayConfig>(AssociatedObject);

            if (mapTipsConfig != null)
            {
                if (AssociatedObject.IsChecked.Value)
                {
                    mapTipsConfig.FieldInfo_AttributeDisplayChecked(this.AssociatedObject.DataContext as FieldInfo);
                }
                else
                {
                    mapTipsConfig.FieldInfo_AttributeDisplayUnChecked(this.AssociatedObject.DataContext as FieldInfo);
                }
            }
        }
Пример #5
0
        void AssociatedObject_Click(object sender, RoutedEventArgs e)
        {
            DataGridColumnHeader header = ControlTreeHelper.FindAncestorOfType <DataGridColumnHeader>(AssociatedObject);

            if (header == null)
            {
                return;
            }

            FieldInfo fieldInfo = header.Content as FieldInfo;

            if (fieldInfo == null)
            {
                return;
            }

            AttributeDisplay attrDisplay = ControlTreeHelper.FindAncestorOfType <AttributeDisplay>(AssociatedObject);

            if (attrDisplay != null)
            {
                attrDisplay.RaiseSortedEvent(fieldInfo);
            }
        }