/// <summary>
        /// Static constructor for the <see cref="NavigationPanelItem"/> 
        /// class registering dependency properties and events.
        /// </summary>
        static NavigationPanelItem()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(NavigationPanelItem), new FrameworkPropertyMetadata(typeof(NavigationPanelItem)));

            NavigationPanelItemNameProperty = DependencyProperty.Register(
                "NavigationPanelItemName", typeof(string), typeof(NavigationPanelItem));

            ImageLocationProperty = DependencyProperty.Register(
                "ImageLocation", typeof(string), typeof(NavigationPanelItem));

            NavigationListProperty = DependencyProperty.Register(
                "NavigationList", typeof(List<NavigationList>), typeof(NavigationList), new FrameworkPropertyMetadata(new List<NavigationList>()));

            IsSelectedProperty = DependencyProperty.Register(
                "IsSelected", typeof(bool), typeof(NavigationPanelItem));

            CommandProperty = DependencyProperty.Register(
                "Command", typeof(ICommand), typeof(NavigationPanelItem));

            CommandParameterProperty = DependencyProperty.Register(
                "CommandParameter", typeof(object), typeof(NavigationPanelItem));

            CommandTargetProperty = DependencyProperty.Register(
                "CommandTarget", typeof(UIElement), typeof(NavigationPanelItem));

            ItemClickedEvent = EventManager.RegisterRoutedEvent(
                "ItemClicked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(NavigationPanelItem));
        }
示例#2
0
 public CommentRoutedEventArgs(RoutedEvent routedEvent, Comment c, CommentUC control, bool requiresDataRecontext)
     : base(routedEvent)
 {
     Comment = c;
     CommentControl = control;
     this.RequiresDataRecontext = requiresDataRecontext;
 }
示例#3
0
文件: ScaleBar.cs 项目: cg123/xenko
 public RoutedDependencyPropertyChangedEventArgs(RoutedEvent routedEvent, DependencyProperty dependencyProperty, object oldValue, object newValue)
 {
     RoutedEvent = routedEvent;
     DependencyProperty = dependencyProperty;
     OldValue = oldValue;
     NewValue = newValue;
 }
 protected ExecutionConnectionDragEventArgs(RoutedEvent routedEvent, object source, object node, object executionConnection, object executionConnector) :
     base(routedEvent, source)
 {
     this.node = node;
     this.draggedOutExecutionConnector = executionConnector;
     this.executionConnection = executionConnection;
 }
示例#5
0
        public CardsEventArgs(Card card, IEnumerable<Card> cards, RoutedEvent routedEvent, object src)
            : base(routedEvent, src)
        {
            ClickedCard = card;
            Cards = cards.ToArray();
			CardSizes = new Size[Cards.Length];
        }
示例#6
0
 static TimelineBar()
 {
     // events
     TimelineSelectedEvent = EventManager.RegisterRoutedEvent(
         "TimelineSelected", RoutingStrategy.Bubble,
         typeof(RoutedEventHandler), typeof(TimelineBar));
 }
示例#7
0
		static void RaiseCaptureEvent(Contact contact, RoutedEvent routedEvent, DependencyObject source, long timestamp)
		{
			ContactEventArgs args = new ContactEventArgs(contact, timestamp);
			args.RoutedEvent = routedEvent;
			args.Source = source;
			MultitouchLogic.RaiseEvent(source, args);
		}
 public static void RaiseKeyboardEvent(this UIElement self, RoutedEvent evt, Key key)
 {
     self.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, new FakePresentationSource(), 0, key)
     {
         RoutedEvent = evt
     });
 }
示例#9
0
        static CommandSelector()
        {
            CommandProperty = DependencyProperty.Register(
                "Command",
                typeof(ICommand),
                typeof(CommandSelector),
                new FrameworkPropertyMetadata(OnCommandChanged) {
                    BindsTwoWayByDefault = true
                }
            );

            CommandsSourceProperty = DependencyProperty.Register(
                "CommandsSource",
                typeof(object),
                typeof(CommandSelector),
                new PropertyMetadata(OnCommandsSourceChanged)
            );

            FilterProperty = DependencyProperty.Register(
                "Filter",
                typeof(object),
                typeof(CommandSelector),
                new PropertyMetadata(null, OnFilterChanged)
            );

            CommandChangedEvent = EventManager.RegisterRoutedEvent(
                "CommandChanged",
                RoutingStrategy.Bubble,
                typeof(RoutedPropertyChangedEventHandler<ICommand>),
                typeof(CommandSelector)
            );
        }
示例#10
0
 static SelectionCanvas()
 {
     FigureSelectedEvent =
         EventManager.RegisterRoutedEvent("FigureSelected", RoutingStrategy.Bubble, typeof(FigureSelectedEventHandler), typeof(SelectionCanvas));
     FiguresUpdatedEvent =
         EventManager.RegisterRoutedEvent("FigureUpdated", RoutingStrategy.Bubble, typeof(FiguresUpdatedEventHandler), typeof(SelectionCanvas));
 }
示例#11
0
        public static void RemoveHandler(DependencyObject element, RoutedEvent routedEvent, Delegate handler)
        {
            if (element == null) { throw new ArgumentNullException("element"); }

            var uie = element as UIElement;
            if (uie != null)
            {
                uie.RemoveHandler(routedEvent, handler);
            }
            else
            {
                var ce = element as ContentElement;
                if (ce != null)
                {
                    ce.RemoveHandler(routedEvent, handler);
                }
                else
                {
                    var u3d = element as UIElement3D;
                    if (u3d != null)
                        u3d.RemoveHandler(routedEvent, handler);
                    else
                        throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Invalid element {0}.", element.GetType()));
                }
            }
        }
		/// <summary>
		///     Initializes a new instance of the <see cref="PropertyValueChangedEventArgs" /> class.
		/// </summary>
		/// <param name="routedEvent">The routed event.</param>
		/// <param name="property">The property.</param>
		/// <param name="oldValue">The old value.</param>
		public PropertyValueChangedEventArgs(RoutedEvent routedEvent, PropertyItem property, object[] oldValue)
			: base(routedEvent, property)
		{
			Property = property;
			NewValue = property.PropertyValue;
			OldValue = oldValue;
		}
 /// <summary>
 /// Creates a new PathConversionEventArgs class.
 /// </summary>
 /// <param name="mode">The conversion mode.</param>
 /// <param name="path">The initial values for DisplayPath and EditPath.</param>
 /// <param name="root">The root object.</param>
 /// <param name="routedEvent"></param>
 public PathConversionEventArgs(ConversionMode mode, string path, object root, RoutedEvent routedEvent)
     : base(routedEvent)
 {
     Mode = mode;
     DisplayPath = EditPath = path;
     Root = root;
 }
        public DialogOpenedEventArgs(DialogSession session, RoutedEvent routedEvent)
        {
            if (session == null) throw new ArgumentNullException(nameof(session));

            Session = session;
            RoutedEvent = routedEvent;
        }
 internal static void RemoveWeakHandler(
     this UIElement source,
     RoutedEvent routedEvent,
     EventHandler<RoutedEventArgs> handler)
 {
     switch (routedEvent.Name)
     {
         case nameof(UIElement.GotKeyboardFocus):
             GotKeyboardFocusEventManager.RemoveHandler(source, handler);
             break;
         case nameof(UIElement.MouseUp):
             MouseUpEventManager.RemoveHandler(source, handler);
             break;
         case nameof(UIElement.PreviewMouseLeftButtonDown):
             PreviewMouseLeftButtonDownEventManager.RemoveHandler(source, handler);
             break;
         case nameof(UIElement.MouseLeftButtonDown):
             MouseLeftButtonDownEventManager.RemoveHandler(source, handler);
             break;
         case nameof(Control.MouseDoubleClick):
             MouseDoubleClickEventManager.RemoveHandler(source, handler);
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
 public PageChangedEventArgs(RoutedEvent EventToRaise, int OldPage, int NewPage, int TotalPages)
     : base(EventToRaise)
 {
     _OldPage = OldPage;
     _NewPage = NewPage;
     _TotalPages = TotalPages;
 }
示例#17
0
 static ToolboxItem()
 {
     DefaultStyleKeyProperty.OverrideMetadata(typeof(ToolboxItem), new FrameworkPropertyMetadata(typeof(ToolboxItem)));
     IsPressedProperty = DependencyProperty.Register("IsPressed", typeof(bool), typeof(ToolboxItem));
     ToolboxItem.ToolboxItemContentTemplateProperty = DependencyProperty.Register("ToolboxItemContentTemplate", typeof(DataTemplate), typeof(ToolboxItem));
     ClickEvent = Button.ClickEvent;
 }
        public DragablzDragDeltaEventArgs(RoutedEvent routedEvent, object source, DragablzItem dragablzItem, DragDeltaEventArgs dragDeltaEventArgs) 
            : base(routedEvent, source, dragablzItem)
        {
            if (dragDeltaEventArgs == null) throw new ArgumentNullException("dragDeltaEventArgs");

            _dragDeltaEventArgs = dragDeltaEventArgs;
        }
示例#19
0
		static BrushComboBox()
		{
			SelectedIndexProperty = DependencyProperty.Register("SelectedIndex", typeof(int), typeof(BrushComboBox));
			SelectedItemProperty = DependencyProperty.Register("SelectedItem", typeof(SolidColorBrush), typeof(BrushComboBox));
            ColorChangedEvent = EventManager.RegisterRoutedEvent("ColorChanged", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(BrushComboBox));
            IsEmptyColorProperty = DependencyProperty.Register("IsEmptyColor", typeof(bool), typeof(BrushComboBox));
		}
示例#20
0
 protected ConnectionDragEventArgs(RoutedEvent routedEvent, object source,
     ElementItem elementItem, ConnectorItem sourceConnectorItem)
     : base(routedEvent, source)
 {
     _elementItem = elementItem;
     _sourceConnectorItem = sourceConnectorItem;
 }
 protected ConnectionDragEventArgs(RoutedEvent routedEvent, object source, object node, object connection, object connector) :
     base(routedEvent, source)
 {
     this.node = node;
     this.draggedOutConnector = connector;
     this.connection = connection;
 }
 public RoutedIdentifiedEventArgs(RoutedEvent e, ClientIdentity clientId, object source)
     : base(e, source)
 {
     if (clientId == null)
         throw new NotSupportedException("clientId cannot be null.");
     this.ClientId = clientId;
 }
示例#23
0
 private EventTriggerHandler(FrameworkElement element, RoutedEvent routedEvent, IEnumerable<ITriggerAction> actions, BaseValueSource valueSource)
 {
     this.element = element;
     this.routedEvent = routedEvent;
     this.actions = actions;
     this.valueSource = valueSource;
 }
        // Registers a RoutedEvent with the given details
        // NOTE: The Name must be unique within the given OwnerType
        internal static RoutedEvent RegisterRoutedEvent(
            string name,
            RoutingStrategy routingStrategy,
            Type handlerType,
            Type ownerType)
        {
            Debug.Assert(GetRoutedEventFromName(name, ownerType, false) == null, 
                                "RoutedEvent name must be unique within a given OwnerType");

            lock (Synchronized)
            {
                // Create a new RoutedEvent
                // Requires GlobalLock to access _countRoutedEvents
                RoutedEvent routedEvent = new RoutedEvent(
                    name, 
                    routingStrategy, 
                    handlerType, 
                    ownerType);
                
                // Increment the count for registered RoutedEvents
                // Requires GlobalLock to access _countRoutedEvents
                _countRoutedEvents++;

                AddOwner(routedEvent, ownerType);

                return routedEvent;
            }
        }
    public CellValidationErrorRoutedEventArgs( RoutedEvent routedEvent, object source, CellValidationError cellValidationError )
      : base( routedEvent, source )
    {
      if( cellValidationError == null )
        throw new ArgumentNullException( "cellValidationError" );

      m_cellValidationError = cellValidationError;
    }
 private static void CheckMouseEvent(TestWindow window, IInputElement button, RoutedEvent routedEvent, bool shouldBeHandled)
 {
     var args = new MouseButtonEventArgs(Mouse.PrimaryDevice, (int) DateTime.Now.Ticks, MouseButton.Left);
     args.RoutedEvent = routedEvent;
     button.RaiseEvent(args);
     window.ProcessEvents();
     Assert.AreEqual(shouldBeHandled, args.Handled);
 }
示例#27
0
        public static DependencyProperty CreateCommandExecutionEventBehaviour(RoutedEvent routedEvent, string propertyName, Type ownerType)
        {
            DependencyProperty property = DependencyProperty.RegisterAttached(propertyName, typeof (ICommand), ownerType,
                                                               new PropertyMetadata(null,
                                                                   new ExecuteCommandOnRoutedEventBehaviour(routedEvent).PropertyChangedHandler));

            return property;
        }
    public RowValidationErrorRoutedEventArgs( RoutedEvent routedEvent, object source, RowValidationError rowValidationError )
      : base( routedEvent, source )
    {
      if( rowValidationError == null )
        throw new ArgumentNullException( "rowValidationError" );

      m_rowValidationError = rowValidationError;
    }
示例#29
0
        static DoubleNumericBox()
        {
            MinValueProperty = DependencyProperty.Register("MinValue", typeof(double), typeof(DoubleNumericBox), new FrameworkPropertyMetadata(0D));
            ValueProperty = DependencyProperty.Register("Value", typeof(double), typeof(DoubleNumericBox), new FrameworkPropertyMetadata(0D, ValueCallback));
            MaxValueProperty = DependencyProperty.Register("MaxValue", typeof(double), typeof(DoubleNumericBox), new FrameworkPropertyMetadata(Double.MaxValue));

            ValueChangedEvent = EventManager.RegisterRoutedEvent("ValueChanged", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(DoubleNumericBox));
        }
示例#30
0
 public EventTrigger(RoutedEvent routedEvent)
 {
     this.routedEvent = routedEvent;
 }
示例#31
0
 /// <summary>
 ///     Constructor for <see cref="RoutedEventArgs"/>
 /// </summary>
 /// <param name="routedEvent">The new value that the RoutedEvent Property is being set to </param>
 public RoutedEventArgs(RoutedEvent routedEvent) : this(routedEvent, null)
 {
 }
示例#32
0
 /// <summary>
 ///     Constructor for <see cref="RoutedEventArgs"/>
 /// </summary>
 /// <param name="source">The new value that the SourceProperty is being set to </param>
 /// <param name="routedEvent">The new value that the RoutedEvent Property is being set to </param>
 public RoutedEventArgs(RoutedEvent routedEvent, object source)
 {
     _routedEvent = routedEvent;
     _source      = _originalSource = source;
 }
示例#33
0
 public void AddHandler(System.Windows.RoutedEvent routedEvent, System.Delegate handler, bool handledEventsToo)
 {
     inter.AddHandler(routedEvent, handler, handledEventsToo);
 }
示例#34
0
 public ReportTimeEventArgs(System.Windows.RoutedEvent routedEvent, object source) : base(routedEvent, source)
 {
 }
示例#35
0
 public NumericUpDownChangedRoutedEventArgs(System.Windows.RoutedEvent routedEvent, double interval)
 {
     Class6.yDnXvgqzyB5jw();
     base(routedEvent);
     this.Interval = interval;
 }
示例#36
0
 public void RemoveHandler(System.Windows.RoutedEvent routedEvent, System.Delegate handler)
 {
     inter.RemoveHandler(routedEvent, handler);
 }
示例#37
0
 /// <summary>
 /// Create the static resources for a collection of FieldDefinitions.
 /// </summary>
 static ReportFieldCollection()
 {
     // CollectionChanged Routed Event
     ReportFieldCollection.CollectionChangedEvent = EventManager.RegisterRoutedEvent("CollectionChanged",
                                                                                     RoutingStrategy.Bubble, typeof(CollectionChangedEventHandler), typeof(ReportFieldCollection));
 }
示例#38
0
 /// <summary>
 ///  Constructor with an event.
 /// </summary>
 /// <param name="routedEvent"> This gives you the routedEvent</param>
 public ChangedGridViewEventArgs(System.Windows.RoutedEvent routedEvent) : base(routedEvent)
 {
 }
示例#39
0
 /// <summary>
 ///     Changes the RoutedEvent assocatied with these RoutedEventArgs
 /// </summary>
 /// <remarks>
 ///     Only used internally.  Added to support cracking generic MouseButtonDown/Up events
 ///     into MouseLeft/RightButtonDown/Up events.
 /// </remarks>
 /// <param name="newRoutedEvent">
 ///     The new RoutedEvent to associate with these RoutedEventArgs
 /// </param>
 internal void OverrideRoutedEvent(RoutedEvent newRoutedEvent)
 {
     _routedEvent = newRoutedEvent;
 }
示例#40
0
 public PropInspRoutedEventArgs(System.Windows.RoutedEvent InspectSubObjectEvent, IPropertyInspectable SubObject)
     : base(InspectSubObjectEvent)
 {
     // TODO: Complete member initialization
     this.SubObject = SubObject;
 }
        public DialogClosingEventArgs(DialogSession session, object parameter, RoutedEvent routedEvent, object source) : base(routedEvent, source)
        {
            if (session == null) throw new ArgumentNullException(nameof(session));
            Session = session;

            Parameter = parameter;            
        }