本文整理汇总了C#中System.Windows.RoutedEvent类的典型用法代码示例。如果您正苦于以下问题:C# RoutedEvent类的具体用法?C# RoutedEvent怎么用?C# RoutedEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoutedEvent类属于System.Windows命名空间,在下文中一共展示了RoutedEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectionCanvas
static SelectionCanvas()
{
FigureSelectedEvent =
EventManager.RegisterRoutedEvent("FigureSelected", RoutingStrategy.Bubble, typeof(FigureSelectedEventHandler), typeof(SelectionCanvas));
FiguresUpdatedEvent =
EventManager.RegisterRoutedEvent("FigureUpdated", RoutingStrategy.Bubble, typeof(FiguresUpdatedEventHandler), typeof(SelectionCanvas));
}
示例2: ExecutionConnectionDragEventArgs
protected ExecutionConnectionDragEventArgs(RoutedEvent routedEvent, object source, object node, object executionConnection, object executionConnector) :
base(routedEvent, source)
{
this.node = node;
this.draggedOutExecutionConnector = executionConnector;
this.executionConnection = executionConnection;
}
示例3: EventTriggerHandler
private EventTriggerHandler(FrameworkElement element, RoutedEvent routedEvent, IEnumerable<ITriggerAction> actions, BaseValueSource valueSource)
{
this.element = element;
this.routedEvent = routedEvent;
this.actions = actions;
this.valueSource = valueSource;
}
示例4: RaiseKeyboardEvent
public static void RaiseKeyboardEvent(this UIElement self, RoutedEvent evt, Key key)
{
self.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, new FakePresentationSource(), 0, key)
{
RoutedEvent = evt
});
}
示例5: RegisterRoutedEvent
// 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;
}
}
示例6: BrushComboBox
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));
}
示例7: RoutedIdentifiedEventArgs
public RoutedIdentifiedEventArgs(RoutedEvent e, ClientIdentity clientId, object source)
: base(e, source)
{
if (clientId == null)
throw new NotSupportedException("clientId cannot be null.");
this.ClientId = clientId;
}
示例8: RoutedDependencyPropertyChangedEventArgs
public RoutedDependencyPropertyChangedEventArgs(RoutedEvent routedEvent, DependencyProperty dependencyProperty, object oldValue, object newValue)
{
RoutedEvent = routedEvent;
DependencyProperty = dependencyProperty;
OldValue = oldValue;
NewValue = newValue;
}
示例9: NavigationPanelItem
/// <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));
}
示例10: DialogClosingEventArgs
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;
}
示例11: ConnectionDragEventArgs
protected ConnectionDragEventArgs(RoutedEvent routedEvent, object source,
ElementItem elementItem, ConnectorItem sourceConnectorItem)
: base(routedEvent, source)
{
_elementItem = elementItem;
_sourceConnectorItem = sourceConnectorItem;
}
示例12: PageChangedEventArgs
public PageChangedEventArgs(RoutedEvent EventToRaise, int OldPage, int NewPage, int TotalPages)
: base(EventToRaise)
{
_OldPage = OldPage;
_NewPage = NewPage;
_TotalPages = TotalPages;
}
示例13: CommandSelector
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)
);
}
示例14: RemoveHandler
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()));
}
}
}
示例15: ConnectionDragEventArgs
protected ConnectionDragEventArgs(RoutedEvent routedEvent, object source, object node, object connection, object connector) :
base(routedEvent, source)
{
this.node = node;
this.draggedOutConnector = connector;
this.connection = connection;
}