/// <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)); }
public CommentRoutedEventArgs(RoutedEvent routedEvent, Comment c, CommentUC control, bool requiresDataRecontext) : base(routedEvent) { Comment = c; CommentControl = control; this.RequiresDataRecontext = requiresDataRecontext; }
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; }
public CardsEventArgs(Card card, IEnumerable<Card> cards, RoutedEvent routedEvent, object src) : base(routedEvent, src) { ClickedCard = card; Cards = cards.ToArray(); CardSizes = new Size[Cards.Length]; }
static TimelineBar() { // events TimelineSelectedEvent = EventManager.RegisterRoutedEvent( "TimelineSelected", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TimelineBar)); }
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 }); }
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) ); }
static SelectionCanvas() { FigureSelectedEvent = EventManager.RegisterRoutedEvent("FigureSelected", RoutingStrategy.Bubble, typeof(FigureSelectedEventHandler), typeof(SelectionCanvas)); FiguresUpdatedEvent = EventManager.RegisterRoutedEvent("FigureUpdated", RoutingStrategy.Bubble, typeof(FiguresUpdatedEventHandler), typeof(SelectionCanvas)); }
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; }
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; }
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)); }
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; }
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); }
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; }
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)); }
public EventTrigger(RoutedEvent routedEvent) { this.routedEvent = routedEvent; }
/// <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) { }
/// <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; }
public void AddHandler(System.Windows.RoutedEvent routedEvent, System.Delegate handler, bool handledEventsToo) { inter.AddHandler(routedEvent, handler, handledEventsToo); }
public ReportTimeEventArgs(System.Windows.RoutedEvent routedEvent, object source) : base(routedEvent, source) { }
public NumericUpDownChangedRoutedEventArgs(System.Windows.RoutedEvent routedEvent, double interval) { Class6.yDnXvgqzyB5jw(); base(routedEvent); this.Interval = interval; }
public void RemoveHandler(System.Windows.RoutedEvent routedEvent, System.Delegate handler) { inter.RemoveHandler(routedEvent, handler); }
/// <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)); }
/// <summary> /// Constructor with an event. /// </summary> /// <param name="routedEvent"> This gives you the routedEvent</param> public ChangedGridViewEventArgs(System.Windows.RoutedEvent routedEvent) : base(routedEvent) { }
/// <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; }
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; }