Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Input / Command / CanExecuteRoutedEventArgs.cs / 1 / CanExecuteRoutedEventArgs.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Input; namespace System.Windows.Input { ////// Event handler associated with the CanExecute events. /// public delegate void CanExecuteRoutedEventHandler(object sender, CanExecuteRoutedEventArgs e); ////// Event arguments for the CanExecute events. /// public sealed class CanExecuteRoutedEventArgs : RoutedEventArgs { #region Constructors ////// Initializes a new instance of this class. /// /// The command that is being executed. /// The parameter that was passed when executing the command. internal CanExecuteRoutedEventArgs(ICommand command, object parameter) { if (command == null) { throw new ArgumentNullException("command"); } _command = command; _parameter = parameter; } #endregion #region Public Properties ////// The command that could be executed. /// public ICommand Command { get { return _command; } } ////// The parameter passed when considering executing the command. /// public object Parameter { get { return _parameter; } } ////// Whether the command with the specified parameter can be executed. /// public bool CanExecute { get { return _canExecute; } set { _canExecute = value; } } ////// Whether the input event (if any) that caused the command /// should continue its route. /// public bool ContinueRouting { get { return _continueRouting; } set { _continueRouting = value; } } #endregion #region Protected Methods ////// Calls the handler. /// /// Handler delegate to invoke /// Target element protected override void InvokeEventHandler(Delegate genericHandler, object target) { CanExecuteRoutedEventHandler handler = (CanExecuteRoutedEventHandler)genericHandler; handler(target as DependencyObject, this); } #endregion #region Data private ICommand _command; private object _parameter; private bool _canExecute; // Defaults to false private bool _continueRouting; // Defaults to false #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DbParameterCollectionHelper.cs
- WebPartConnectionsDisconnectVerb.cs
- RangeValueProviderWrapper.cs
- DependencyPropertyHelper.cs
- LicenseException.cs
- Debugger.cs
- CalculatedColumn.cs
- SiteMapNodeItem.cs
- NameValueConfigurationCollection.cs
- RootContext.cs
- ErrorEventArgs.cs
- ToolStripDropDownItem.cs
- SmtpClient.cs
- BindingObserver.cs
- BuildProvidersCompiler.cs
- DataGridHeaderBorder.cs
- IgnoreFlushAndCloseStream.cs
- OrthographicCamera.cs
- DBBindings.cs
- UrlMappingCollection.cs
- RolePrincipal.cs
- BCryptSafeHandles.cs
- DataGridViewSelectedRowCollection.cs
- RouteParameter.cs
- MediaContextNotificationWindow.cs
- PermissionRequestEvidence.cs
- XmlEventCache.cs
- LabelLiteral.cs
- EnvelopedPkcs7.cs
- TypeSystem.cs
- DataControlField.cs
- DSASignatureFormatter.cs
- ComContractElement.cs
- ConnectionInterfaceCollection.cs
- EventEntry.cs
- WindowsTab.cs
- ClientOptions.cs
- DependencyObjectPropertyDescriptor.cs
- CodeParameterDeclarationExpression.cs
- FreezableCollection.cs
- BidOverLoads.cs
- VisualTreeUtils.cs
- SqlParameterizer.cs
- EntityProviderFactory.cs
- LogFlushAsyncResult.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- SoapReflector.cs
- OperationFormatter.cs
- InstanceContextMode.cs
- WebPartZone.cs
- UrlMappingsModule.cs
- XmlComment.cs
- CapabilitiesPattern.cs
- SqlRemoveConstantOrderBy.cs
- CommonDialog.cs
- ChannelAcceptor.cs
- XmlBinaryReader.cs
- BamlLocalizationDictionary.cs
- ProgressBar.cs
- SafeTokenHandle.cs
- TypeUtils.cs
- ComponentDispatcherThread.cs
- OptimizedTemplateContent.cs
- XmlEncoding.cs
- DateTimeOffsetConverter.cs
- Geometry.cs
- WebPartZoneDesigner.cs
- Propagator.cs
- PointLight.cs
- OleDbPropertySetGuid.cs
- EventMappingSettings.cs
- WebMessageEncoderFactory.cs
- CompositionCommandSet.cs
- OdbcUtils.cs
- SchemaRegistration.cs
- VSDExceptions.cs
- BindingListCollectionView.cs
- CheckedListBox.cs
- KeyValuePair.cs
- StopStoryboard.cs
- TextRangeEdit.cs
- PositiveTimeSpanValidator.cs
- SerialStream.cs
- DateTimeConstantAttribute.cs
- QueryResponse.cs
- Encoder.cs
- PropertyChangedEventArgs.cs
- VisualStyleRenderer.cs
- XsltContext.cs
- XmlAnyElementAttributes.cs
- KeyValueConfigurationCollection.cs
- wmiprovider.cs
- XmlExpressionDumper.cs
- TextServicesManager.cs
- Adorner.cs
- DefaultClaimSet.cs
- ListDataHelper.cs
- XmlWrappingReader.cs
- ConfigXmlDocument.cs
- AssemblyBuilder.cs