Exemplo n.º 1
0
        /// <summary>
        /// Delegate called when the selection state changed.
        /// </summary>
        /// <param name="pObject">The modified control.</param>
        /// <param name="pEventArgs">The event arguments.</param>
        private static void OnIsSelectedChanged(DependencyObject pObject, DependencyPropertyChangedEventArgs pEventArgs)
        {
            AGraphItemContainer lItem = pObject as AGraphItemContainer;

            if (lItem != null)
            {
                lItem.UpdateVisualState();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Method called when the control template is applied.
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            // Getting the parts of the control.
            this.TemplateControl = this.GetTemplateChild(PART_TEMPLATE_CONTROL) as AGraphItemContainer;

            if (this.TemplateControl == null)
            {
                throw new Exception("GraphItem control template not correctly defined.");
            }
        }