本文整理汇总了C#中System.Windows.Data.DataTransferEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataTransferEventArgs类的具体用法?C# DataTransferEventArgs怎么用?C# DataTransferEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataTransferEventArgs类属于System.Windows.Data命名空间,在下文中一共展示了DataTransferEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: chkClose_SourceUpdated
private void chkClose_SourceUpdated(object sender, DataTransferEventArgs e)
{
if ((bool)this.chkClose.IsChecked && !(bool)this.chkManualClose.IsChecked)
{
this.Close();
}
}
示例2: ItemsControl_TargetUpdated_1
private void ItemsControl_TargetUpdated_1(object sender, DataTransferEventArgs e)
{
var sw = DataContext as MenuItemSelectorViewModel;
if (sw == null) return;
NumeratorRow.Height = sw.IsNumeratorVisible ? _auto45 : _thin;
//AlphaButtonsColumn.Width = sw.AlphaButtonValues != null && sw.AlphaButtonValues.Length > 0 ? _auto15 : _thin;
}
示例3: TargetUpdated
void TargetUpdated( object sender, DataTransferEventArgs e )
{
// Trigger a property changed callback as long as the new value equals the default value.
object current = DependencyObject.GetValue( DependencyProperty );
PropertyMetadata metaData = DependencyProperty.GetMetadata( DependencyObject );
bool equals = current == null ? current == metaData.DefaultValue : current.Equals( metaData.DefaultValue );
if ( equals )
{
if ( metaData.PropertyChangedCallback != null )
{
metaData.PropertyChangedCallback.Invoke(
DependencyObject,
new DependencyPropertyChangedEventArgs(
DependencyProperty,
current,
current ) );
}
}
else
{
// Once it is no longer the default value, we know it has been changed.
_frameworkElement.TargetUpdated -= TargetUpdated;
NotifyOnTargetUpdated = _prevNotifyOnTargetUpdated;
}
}
示例4: OnComboBoxSourceUpdated
private void OnComboBoxSourceUpdated(object sender, DataTransferEventArgs e)
{
var comboBox = sender as ComboBox;
if (comboBox != null)
{
comboBox.IsDropDownOpen = true;
}
}
示例5: SourcePathTextBox_SourceUpdated
private async void SourcePathTextBox_SourceUpdated(object sender, DataTransferEventArgs e) {
Debug.Assert(DataContext is ImportSettings);
var settings = (ImportSettings)DataContext;
SourcePathDoesNotExist.Visibility =
(string.IsNullOrEmpty(settings.SourcePath) || Directory.Exists(settings.SourcePath)) ?
System.Windows.Visibility.Collapsed :
System.Windows.Visibility.Visible;
await settings.UpdateSourcePathAsync().HandleAllExceptions(SR.ProductName);
}
示例6: WayRef_SourceUpdated
private void WayRef_SourceUpdated(object sender, DataTransferEventArgs e)
{
var model = this.DataContext as DishesWayRefViewModel;
if (model != null)
{
model.SavePrice2WayRef();
}
}
示例7: TextBox_OnTextChanged
private void TextBox_OnTextChanged(object sender, DataTransferEventArgs e)
{
if (IssueList.SelectedIndex == -1)
return;
var bcf = this.DataContext as BcfFile;
if (bcf == null)
return;
//if (e.Key != Key.Up && e.Key != Key.Down && e.Key != Key.Left && e.Key != Key.Right)
bcf.HasBeenSaved = false;
}
示例8: Binding_TargetUpdated
private void Binding_TargetUpdated(object sender, DataTransferEventArgs e)
{
string txt = TestTextBox.Text;
mbindingExpression =
BindingOperations.GetMultiBindingExpression(e.TargetObject, e.Property);
mbindingExpression.UpdateSource();
foreach (var bind in mbindingExpression.BindingExpressions)
bind.UpdateSource();
}
示例9: workingItemsDataGridTargetUpdated
private void workingItemsDataGridTargetUpdated(object sender, DataTransferEventArgs e)
{
todosDataGrid.UpdateLayout();
var workingItemsDataGrid = UIHelper.FindChild<DataGrid>(todosDataGrid, "workingItemsDataGrid");
if (workingItemsDataGrid != null)
{
workingItemsDataGrid.Columns[2].Width = 0;
workingItemsDataGrid.UpdateLayout();
workingItemsDataGrid.Columns[2].Width = new DataGridLength(1, DataGridLengthUnitType.Star);
}
}
示例10: line_TargetUpdated
private void line_TargetUpdated(object sender, DataTransferEventArgs e)
{
tb1.GetBindingExpression(TextBlock.HorizontalAlignmentProperty).UpdateTarget();
tb1.GetBindingExpression(TextBlock.MarginProperty).UpdateTarget();
tb2.GetBindingExpression(TextBlock.HorizontalAlignmentProperty).UpdateTarget();
tb2.GetBindingExpression(TextBlock.MarginProperty).UpdateTarget();
line.GetBindingExpression(Line.VisibilityProperty).UpdateTarget();
line2.GetBindingExpression(Line.VisibilityProperty).UpdateTarget();
line3.GetBindingExpression(Line.VisibilityProperty).UpdateTarget();
selectionRectangle1.GetBindingExpression(Rectangle.MarginProperty).UpdateTarget();
selectionRectangle2.GetBindingExpression(Rectangle.MarginProperty).UpdateTarget();
}
示例11: Selector_SourceUpdated
private void Selector_SourceUpdated(object sender, DataTransferEventArgs e)
{
ChooseShowTableViewModel model = this.DataContext as ChooseShowTableViewModel;
if (model.Selector == 1)
{
ViewTabControl.SelectedIndex=0;
}
else {
ViewTabControl.SelectedIndex = 1;
}
}
示例12: OnTargetUpdated
private void OnTargetUpdated(object sender, DataTransferEventArgs args)
{
// Handle event
var fe = sender as FrameworkElement;
infoText.Text = "";
infoText.Text += args.Property.Name + " property of a " + args.Property.OwnerType.Name;
infoText.Text += " element (";
infoText.Text += fe.Name;
infoText.Text += ") updated...";
infoText.Text += DateTime.Now.ToLongDateString();
infoText.Text += " at ";
infoText.Text += DateTime.Now.ToLongTimeString();
}
示例13: OnControlTargetUpdated
/// <remarks>
/// To fire this event you must add in column binding: NotifyOnTargetUpdated=True
/// </remarks>
private static void OnControlTargetUpdated(object sender, DataTransferEventArgs e)
{
var listView = sender as ListView;
var dataGrid = sender as DataGrid;
if (listView != null && listView.View is GridView)
{
var gridView = listView.View as GridView;
gridView.Columns.ForEach(x =>
{
if (double.IsNaN(x.Width))
{
x.Width = x.ActualWidth;
}
x.Width = double.NaN;
});
}
}
示例14: CurrentCellSourceUpdated
/// <summary>
/// Handles changes in the current cell.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="DataTransferEventArgs" /> instance containing the event data.</param>
/// <param name="changedCell">The cell that was changed.</param>
private void CurrentCellSourceUpdated(object sender, DataTransferEventArgs e, CellRef changedCell)
{
// The source of the binding for the current cell was updated
// (e.g. check box (display control) was changed or a combo box (edit control) was changed
var value = this.GetCellValue(changedCell);
var selectedCells = this.SelectedCells.ToArray();
if (!selectedCells.Contains(changedCell))
{
// do not set other cells when changed cell is outside selection
return;
}
// Set the same value in all selected cells.
foreach (var cell in selectedCells)
{
if (changedCell.Equals(cell))
{
// this value should already be set by the binding
continue;
}
if (this.MultiChangeInChangedColumnOnly && cell.Column != changedCell.Column)
{
// do not change value in other columns when this property is set to true
continue;
}
this.TrySetCellValue(cell, value);
}
}
示例15: PagesListBox_SourceUpdated
private void PagesListBox_SourceUpdated(object sender, DataTransferEventArgs e)
{
}