本文整理汇总了C#中RoutedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# RoutedEventArgs类的具体用法?C# RoutedEventArgs怎么用?C# RoutedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoutedEventArgs类属于命名空间,在下文中一共展示了RoutedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGotFocus
protected override void OnGotFocus(RoutedEventArgs e)
{
_hasFocus = true;
SetHintVisibility(Visibility.Collapsed);
base.OnGotFocus(e);
}
示例2: PasswordChanged
private static void PasswordChanged(object sender, RoutedEventArgs e)
{
PasswordBox password = sender as PasswordBox;
_updating = true;
SetBoundPassword(password, password.Password);
_updating = false;
}
示例3: WindowLoaded
private void WindowLoaded(object sender, RoutedEventArgs e){
// ...
/*
* ------------------ Command Binding ----------------------------
*/
this.CommandBindings.Add(
/*
* CommandBinding Constructor (ICommand, ExecutedRoutedEventHandler, CanExecuteRoutedEventHandler)
*/
new CommandBinding(
CommandBank.CloseWindowCommand, // System.Windows.Input.ICommand. The command to base the new RoutedCommand on.
CommandBank.CloseWindowCommandExecute, // Input.ExecutedRoutedEventHandler. Handler for Executed event on new RoutedCommand.
CommandBank.CanExecuteIfParameterIsNotNull)); // Input.CanExecuteRoutedEventHandler. The handler for CanExecute event on new RoutedCommand.
/*
* ------------------ Input Binding ------------------------------
*/
foreach (CommandBinding binding in this.CommandBindings){
RoutedCommand command = (RoutedCommand)binding.Command;
if (command.InputGestures.Count > 0){
foreach (InputGesture gesture in command.InputGestures){
var iBind = new InputBinding(command, gesture);
iBind.CommandParameter = this;
this.InputBindings.Add(iBind);
}
}
}
// menuItemExit is defined in XAML
menuItemExit.Command = CommandBank.CloseWindow;
menuItemExit.CommandParameter = this;
// ...
}
示例4: OnSubmenuOpened
private static void OnSubmenuOpened(object sender, RoutedEventArgs e)
{
var commandRouter = IoC.Get<ICommandRouter>();
var menuItem = (MenuItem) sender;
foreach (var item in menuItem.Items.OfType<ICommandUiItem>().ToList())
item.Update(commandRouter.GetCommandHandler(item.CommandDefinition));
}
示例5: BackButton_Click
private void BackButton_Click(object sender, RoutedEventArgs e)
{
if (ContentFrame != null && ContentFrame.CanGoBack)
{
ContentFrame.GoBack();
}
}
示例6: DataBinding_Unloaded
void DataBinding_Unloaded(object sender, RoutedEventArgs e)
{
this.Unloaded -= DataBinding_Unloaded;
this.LayoutRoot.Loaded -= new RoutedEventHandler(LayoutRoot_Loaded);
MyMap.Layers["tiledLayer"].Failed -= DataBinding_Failed;
MyMap.Dispose();
}
示例7: TimePickerStudio_Loaded
/// <summary>
/// Handles the Loaded event of the TimePickerStudio control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
private void TimePickerStudio_Loaded(object sender, RoutedEventArgs e)
{
// init
cmbPopupSelectionMode.ItemsSource = typeof(PopupTimeSelectionMode)
.GetMembers()
.ToList()
.Where(m =>
m.DeclaringType.Equals(typeof(PopupTimeSelectionMode)) &&
!m.Name.StartsWith("_", StringComparison.Ordinal) &&
!m.Name.EndsWith("_", StringComparison.Ordinal))
.Select(m => m.Name)
.ToList();
cmbPopup.ItemsSource = new Dictionary<string, Type>()
{
{ "ListTimePicker", typeof(ListTimePickerPopup) },
{ "RangeTimePicker", typeof(RangeTimePickerPopup) },
};
cmbFormat.ItemsSource = new Dictionary<string, ITimeFormat>()
{
{ "ShortTimeFormat", new ShortTimeFormat() },
{ "LongTimeFormat", new LongTimeFormat() },
{ "Custom: hh:mm:ss", new CustomTimeFormat("hh:mm:ss") },
{ "Custom: hh.mm", new CustomTimeFormat("hh.mm") },
};
cmbTimeParser.ItemsSource = new Dictionary<string, TimeParser>()
{
{ "+/- hours, try +3h", new PlusMinusHourTimeParser() },
{ "+/- minutes, try +3m", new PlusMinusMinuteTimeInputParser() },
};
// defaults
cmbFormat.SelectedIndex = 0;
cmbPopupSecondsInterval.SelectedIndex = 1;
cmbPopupMinutesInterval.SelectedIndex = 3;
cmbPopupSelectionMode.SelectedIndex = cmbPopupSelectionMode.Items.ToList().IndexOf(tp.PopupTimeSelectionMode.ToString());
cmbPopup.SelectedIndex = 0;
List<CultureInfo> cultures = new List<CultureInfo>();
// work through long list of cultures and check if it is actually
// allowed in this configuration.
foreach (string cultureName in _cultureNames)
{
try
{
CultureInfo c = new CultureInfo(cultureName);
cultures.Add(c);
}
catch (ArgumentException)
{
}
}
cmbCultures.ItemsSource = cultures;
// preselect current culture.
cmbCultures.SelectedItem = cultures.FirstOrDefault(info => info.Name == tp.ActualCulture.Name);
}
示例8: FundingSummary_Loaded
private async void FundingSummary_Loaded(object sender, RoutedEventArgs e)
{
if (null == ViewModel) return;
ViewModel.StepChanged += this.FundingSummary_StepChanged;
ViewModel.ReSizeGrid += FundingSummary_ResizeGrid;
await ViewModel.OnStepAsync(FundingSummaryViewModel.EnumStep.Start);
}
示例9: button_Click
private void button_Click(object sender, RoutedEventArgs e)
{
//((App)Application.Current).runMe()
sendData();
receiveData();
}
示例10: MainPage_Loaded
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
_timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(2) };
_timer.Tick += _timer_Tick;
_timer.Start();
ButtonLoad.Visibility = Visibility.Collapsed;
}
示例11: OnLostFocus
protected override void OnLostFocus(RoutedEventArgs e)
{
_hasFocus = false;
UpdateHintVisibility();
base.OnLostFocus(e);
}
示例12: ButtonSendLoadCharsClick
private void ButtonSendLoadCharsClick(object sender, RoutedEventArgs e)
{
StatusInformation = "Start load drones characteristics";
_parrotCharacteristics.LoadDevicesCharacteristics(_parrotDrones);
MergeLogActions(_parrotCharacteristics.LogActions);
StatusInformation = "End load drones characteristics";
}
示例13: isVisible_Click
private async void isVisible_Click(object sender, RoutedEventArgs e)
{
SetLayerStatusParameters parameters = new SetLayerStatusParameters
{
HoldTime = 30,
LayerStatusList = layersStatus,
ResourceID = tempLayerID
};
//与服务端交互
try
{
SetLayerStatusService setLayersStatus = new SetLayerStatusService(url);
var result = await setLayersStatus.ProcessAsync(parameters);
if (result.IsSucceed)
{
tempLayerID = result.NewResourceID;
layer.LayersID = result.NewResourceID;
layer.Refresh();
}
}
//交互失败
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
示例14: FlexibleTemplateSample_Loaded
/// <summary>
/// Loads the XML sample data and populates the TreeMap.
/// </summary>
/// <param name="sender">The object where the event handler is attached.</param>
/// <param name="e">The event data.</param>
private void FlexibleTemplateSample_Loaded(object sender, RoutedEventArgs e)
{
// Sample browser-specific layout change
SampleHelpers.ChangeSampleAlignmentToStretch(this);
treeMapControl.ItemsSource = NhlDataHelper.LoadDefaultFile();
}
示例15: OnIsCheckedPropertyChanged
/// <summary>
/// IsCheckedProperty property changed handler.
/// </summary>
/// <param name="d">ToggleButton that changed its IsChecked.</param>
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
private static void OnIsCheckedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
ToggleButton source = d as ToggleButton;
System.Diagnostics.Debug.Assert(source != null,
"The source is not an instance of ToggleButton!");
System.Diagnostics.Debug.Assert(typeof(bool?).IsInstanceOfType(e.NewValue) || (e.NewValue == null),
"The value is not an instance of bool?!");
bool? value = (bool?) e.NewValue;
// Raise the appropriate changed event
RoutedEventArgs args = new RoutedEventArgs () { OriginalSource = source};
if (value == true)
{
source.OnChecked(args);
}
else if (value == false)
{
source.OnUnchecked(args);
}
else
{
source.OnIndeterminate(args);
}
}