private void bb_expanderClickItem(LMD_BLOCKS.EXPANDER_FUNCTION function, UIElement element)
 {
     if (clickItemsExpander != null)
     {
         clickItemsExpander(function, element);
     }
 }
        /// <summary>
        /// Происходит когда юзер выбирает функцию в блоке
        /// </summary>
        /// <param name="function">Тип функции</param>
        /// <param name="element">Выбранный блок</param>
        void workspace_clickItemsExpander(LMD_BLOCKS.EXPANDER_FUNCTION function, UIElement element)
        {
            switch (function)
            {
            case LMD_BLOCKS.EXPANDER_FUNCTION.joint:
                workspace.AddJoint(element); break;

            case LMD_BLOCKS.EXPANDER_FUNCTION.rename: break;

            case LMD_BLOCKS.EXPANDER_FUNCTION.properties: break;

            case LMD_BLOCKS.EXPANDER_FUNCTION.delete: workspace.RemoveBlock(element); break;

            case LMD_BLOCKS.EXPANDER_FUNCTION.cut: break;

            case LMD_BLOCKS.EXPANDER_FUNCTION.copy: break;
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            expander.IsExpanded = false;
            LMD_BLOCKS.EXPANDER_FUNCTION func = LMD_BLOCKS.EXPANDER_FUNCTION.none;
            String msg = ((Button)sender).Content.ToString();

            switch (msg)
            {
            case "Связать": func = LMD_BLOCKS.EXPANDER_FUNCTION.joint; break;

            case "Свойства": func = LMD_BLOCKS.EXPANDER_FUNCTION.properties; break;

            case "Удалить": func = LMD_BLOCKS.EXPANDER_FUNCTION.delete; break;

            default: func = LMD_BLOCKS.EXPANDER_FUNCTION.none; break;
            }

            if (expanderClickItem != null)
            {
                expanderClickItem(func, this);
            }
        }