本文整理汇总了C#中PerspexPropertyChangedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# PerspexPropertyChangedEventArgs类的具体用法?C# PerspexPropertyChangedEventArgs怎么用?C# PerspexPropertyChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PerspexPropertyChangedEventArgs类属于命名空间,在下文中一共展示了PerspexPropertyChangedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnPerspexProperty_valueChanged
/// <summary>
/// Handle when dependency property value changes to update the underline HtmlContainer with the new value.
/// </summary>
private static void OnPerspexProperty_valueChanged(PerspexObject PerspexObject, PerspexPropertyChangedEventArgs e)
{
var control = PerspexObject as HtmlLabel;
if (control != null)
{
if (e.Property == AutoSizeProperty)
{
if ((bool)e.NewValue)
{
PerspexObject.SetValue(AutoSizeHeightOnlyProperty, false);
control.InvalidateMeasure();
control.InvalidateVisual();
}
}
else if (e.Property == AutoSizeHeightOnlyProperty)
{
if ((bool)e.NewValue)
{
PerspexObject.SetValue(AutoSizeProperty, false);
control.InvalidateMeasure();
control.InvalidateVisual();
}
}
}
}
开发者ID:Arlorean,项目名称:Perspex,代码行数:28,代码来源:HtmlLabel.cs
示例2: AdornedElementChanged
private static void AdornedElementChanged(PerspexPropertyChangedEventArgs e)
{
var adorner = (Visual)e.Sender;
var adorned = (Visual)e.NewValue;
var layer = adorner.GetVisualParent<AdornerLayer>();
layer?.UpdateAdornedElement(adorner, adorned);
}
开发者ID:Arlorean,项目名称:Perspex,代码行数:7,代码来源:AdornerLayer.cs
示例3: ValueChanged
private void ValueChanged(PerspexPropertyChangedEventArgs e)
{
if (_indicator != null)
{
double percent = Maximum == Minimum ? 1.0 : ((double)e.NewValue - Minimum) / (Maximum - Minimum);
_indicator.Width = Bounds.Width * percent;
}
}
开发者ID:hacklex,项目名称:Perspex,代码行数:8,代码来源:ProgressBar.cs
示例4: ValueChanged
private void ValueChanged(PerspexPropertyChangedEventArgs e)
{
if (this.indicator != null)
{
double percent = this.Maximum == this.Minimum ? 1.0 : ((double)e.NewValue - this.Minimum) / (this.Maximum - this.Minimum);
this.indicator.Width = this.Bounds.Width * percent;
}
}
开发者ID:Robertofon,项目名称:Perspex,代码行数:8,代码来源:ProgressBar.cs
示例5: IsSelectedChanged
/// <summary>
/// Called when the <see cref="IsSelected"/> property changes on an object.
/// </summary>
/// <param name="e">The sender.</param>
private static void IsSelectedChanged(PerspexPropertyChangedEventArgs e)
{
var interactive = e.Sender as IInteractive;
if (interactive != null)
{
interactive.RaiseEvent(new RoutedEventArgs(SelectingItemsControl.IsSelectedChangedEvent));
}
}
开发者ID:MarkWalls,项目名称:Perspex,代码行数:13,代码来源:ListBoxItem.cs
示例6: SelectedIndexChanged
/// <summary>
/// Called when the <see cref="SelectingItemsControl.SelectedIndex"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private void SelectedIndexChanged(PerspexPropertyChangedEventArgs e)
{
if ((int)e.NewValue != -1)
{
var item = SelectedItem as IContentControl;
var content = item?.Content ?? item;
SelectedTab = item as TabItem;
}
}
开发者ID:healtech,项目名称:Perspex,代码行数:13,代码来源:TabControl.cs
示例7: OnPropertyChanged
/// <summary>
/// Reacts to a change in a <see cref="PerspexProperty"/> value in order to animate the
/// change if a <see cref="PropertyTransition"/> is set for the property..
/// </summary>
/// <param name="e">The event args.</param>
protected override void OnPropertyChanged(PerspexPropertyChangedEventArgs e)
{
if (e.Priority != BindingPriority.Animation && _propertyTransitions != null)
{
var match = _propertyTransitions.FirstOrDefault(x => x.Property == e.Property);
if (match != null)
{
Animate.Property(this, e.Property, e.OldValue, e.NewValue, match.Easing, match.Duration);
}
}
}
开发者ID:rdterner,项目名称:Perspex,代码行数:17,代码来源:Animatable.cs
示例8: ContextMenuChanged
/// <summary>
/// called when the <see cref="ContextMenuProperty"/> property changes on a control.
/// </summary>
/// <param name="e">The event args.</param>
private static void ContextMenuChanged(PerspexPropertyChangedEventArgs e)
{
var control = (Control)e.Sender;
if (e.OldValue != null)
{
control.PointerReleased -= ControlPointerReleased;
}
if (e.NewValue != null)
{
control.PointerReleased += ControlPointerReleased;
}
}
开发者ID:alimbada,项目名称:Perspex,代码行数:18,代码来源:ContextMenu.cs
示例9: TipChanged
/// <summary>
/// called when the <see cref="TipProperty"/> property changes on a control.
/// </summary>
/// <param name="e">The event args.</param>
private static void TipChanged(PerspexPropertyChangedEventArgs e)
{
var control = (Control)e.Sender;
if (e.OldValue != null)
{
control.PointerEnter -= ControlPointerEnter;
control.PointerLeave -= ControlPointerLeave;
}
if (e.NewValue != null)
{
control.PointerEnter += ControlPointerEnter;
control.PointerLeave += ControlPointerLeave;
}
}
开发者ID:rdterner,项目名称:Perspex,代码行数:20,代码来源:ToolTip.cs
示例10: OnIsExpandedChanged
protected virtual void OnIsExpandedChanged(PerspexPropertyChangedEventArgs e)
{
IVisual visualContent = Presenter;
if (Content != null && ContentTransition != null && visualContent != null)
{
bool forward = ExpandDirection == ExpandDirection.Left ||
ExpandDirection == ExpandDirection.Up;
if (IsExpanded)
{
ContentTransition.Start(null, visualContent, forward);
}
else
{
ContentTransition.Start(visualContent, null, !forward);
}
}
}
开发者ID:KvanTTT,项目名称:Perspex,代码行数:18,代码来源:Expander.cs
示例11: ChildChanged
/// <summary>
/// Called when the <see cref="Child"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private void ChildChanged(PerspexPropertyChangedEventArgs e)
{
var oldChild = (Control)e.OldValue;
var newChild = (Control)e.NewValue;
if (oldChild != null)
{
((ISetLogicalParent)oldChild).SetParent(null);
LogicalChildren.Clear();
RemoveVisualChild(oldChild);
}
if (newChild != null)
{
AddVisualChild(newChild);
LogicalChildren.Add(newChild);
((ISetLogicalParent)newChild).SetParent(this);
}
}
开发者ID:rdterner,项目名称:Perspex,代码行数:23,代码来源:Decorator.cs
示例12: ItemsChanged
private static void ItemsChanged(PerspexPropertyChangedEventArgs e)
{
var grid = (Grid)e.Sender;
var items = (IEnumerable)e.NewValue;
var template = grid.GetValue(TemplateProperty);
grid.Children.Clear();
if (items != null)
{
int count = 0;
int cols = grid.ColumnDefinitions.Count;
foreach (var item in items)
{
foreach (var control in template(item))
{
grid.Children.Add(control);
Grid.SetColumn(control, count % cols);
Grid.SetRow(control, count / cols);
++count;
}
}
int rows = (int)Math.Ceiling((double)count / cols);
int difference = rows - grid.RowDefinitions.Count;
if (difference > 0)
{
for (int i = 0; i < difference; ++i)
{
grid.RowDefinitions.Add(new RowDefinition(GridLength.Auto));
}
}
else if (difference < 0)
{
for (int i = 0; i < difference; ++i)
{
grid.RowDefinitions.RemoveAt(grid.RowDefinitions.Count - 1);
}
}
}
}
开发者ID:KvanTTT,项目名称:Perspex,代码行数:43,代码来源:GridRepeater.cs
示例13: IsDefaultChanged
/// <summary>
/// Called when the <see cref="IsDefault"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private static void IsDefaultChanged(PerspexPropertyChangedEventArgs e)
{
var button = e.Sender as Button;
var isDefault = (bool)e.NewValue;
var root = button.GetSelfAndVisualAncestors().OfType<IRenderRoot>().FirstOrDefault();
var inputElement = root as IInputElement;
if (inputElement != null)
{
if (isDefault)
{
button.ListenForDefault(inputElement);
}
else
{
button.StopListeningForDefault(inputElement);
}
}
}
开发者ID:Scellow,项目名称:Perspex,代码行数:23,代码来源:Button.cs
示例14: CommandChanged
/// <summary>
/// Called when the <see cref="Command"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private static void CommandChanged(PerspexPropertyChangedEventArgs e)
{
var button = e.Sender as Button;
if (button != null)
{
var oldCommand = e.OldValue as ICommand;
var newCommand = e.NewValue as ICommand;
if (oldCommand != null)
{
oldCommand.CanExecuteChanged -= button.CanExecuteChanged;
}
if (newCommand != null)
{
newCommand.CanExecuteChanged += button.CanExecuteChanged;
}
button.CanExecuteChanged(button, EventArgs.Empty);
}
}
开发者ID:Scellow,项目名称:Perspex,代码行数:26,代码来源:Button.cs
示例15: ContentChanged
/// <summary>
/// Called when the <see cref="Content"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private void ContentChanged(PerspexPropertyChangedEventArgs e)
{
_createdChild = false;
InvalidateMeasure();
}
开发者ID:Sergey-Terekhin,项目名称:Perspex,代码行数:9,代码来源:ContentPresenter.cs
示例16: ItemsChanged
/// <summary>
/// Called when the <see cref="Items"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private void ItemsChanged(PerspexPropertyChangedEventArgs e)
{
if (_createdPanel)
{
var generator = ItemContainerGenerator;
if (e.OldValue != null)
{
generator.ClearContainers();
Panel.Children.Clear();
INotifyCollectionChanged incc = e.OldValue as INotifyCollectionChanged;
if (incc != null)
{
incc.CollectionChanged -= ItemsCollectionChanged;
}
}
if (Panel != null)
{
CreateItemsAndListenForChanges((IEnumerable)e.NewValue);
}
}
}
开发者ID:g4idrijs,项目名称:Perspex,代码行数:29,代码来源:ItemsPresenter.cs
示例17: ItemsChanged
/// <summary>
/// Caled when the <see cref="Items"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
protected virtual void ItemsChanged(PerspexPropertyChangedEventArgs e)
{
var incc = e.OldValue as INotifyCollectionChanged;
if (incc != null)
{
incc.CollectionChanged += this.ItemsCollectionChanged;
}
var newValue = e.NewValue as IEnumerable;
if (newValue == null || newValue.Count() == 0)
{
this.Classes.Add(":empty");
}
else
{
this.Classes.Remove(":empty");
}
incc = newValue as INotifyCollectionChanged;
if (incc != null)
{
incc.CollectionChanged += this.ItemsCollectionChanged;
}
}
开发者ID:Scellow,项目名称:Perspex,代码行数:31,代码来源:ItemsControl.cs
示例18: SelectedItemChanged
private void SelectedItemChanged(PerspexPropertyChangedEventArgs e)
{
UpdateSelectionBoxItem(e.NewValue);
}
开发者ID:KvanTTT,项目名称:Perspex,代码行数:4,代码来源:DropDown.cs
示例19: ChildChanged
/// <summary>
/// Called when the <see cref="Child"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private void ChildChanged(PerspexPropertyChangedEventArgs e)
{
LogicalChildren.Clear();
if (e.OldValue != null)
{
((ISetLogicalParent)e.OldValue).SetParent(null);
}
if (e.NewValue != null)
{
((ISetLogicalParent)e.NewValue).SetParent(this);
LogicalChildren.Add((ILogical)e.NewValue);
}
}
开发者ID:JackWangCUMT,项目名称:Perspex,代码行数:19,代码来源:Popup.cs
示例20: SelectedItemChanged
/// <summary>
/// Called when the <see cref="SelectingItemsControl.SelectedIndex"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private void SelectedItemChanged(PerspexPropertyChangedEventArgs e)
{
var item = e.NewValue as IContentControl;
var content = item?.Content ?? item;
SelectedTab = item as TabItem;
}
开发者ID:Sergey-Terekhin,项目名称:Perspex,代码行数:10,代码来源:TabControl.cs
注:本文中的PerspexPropertyChangedEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论