public static void SetProcessors(DependencyObject obj, FreezableCollection <UIEventProcessorBase> value) { if (obj != null) { obj.SetValue(ProcessorsProperty, value); } }
public DelegateCommand() { // Bind InheritedDataContextProperty with a default binding which will return the DataContext of DelegateCommand BindingOperations.SetBinding(this, InheritedDataContextProperty, new Binding()); Arguments = new FreezableCollection <DelegateArgument>(); }
public DoubleAnimationUsingKeyFrames() { this.animationOperations = DoubleAnimationOperations.Default; this.isAccumulable = true; KeyFrames = new FreezableCollection <DoubleKeyFrame>(); KeyFrames.SetInheritanceParent(this); }
public ThicknessAnimationUsingKeyFrames() { this.animationOperations = ThicknessAnimationOperations.Default; this.isAccumulable = true; KeyFrames = new FreezableCollection <ThicknessKeyFrame>(); KeyFrames.TrySetContextParent(this); }
public KeyFramesAnimationTimeline(IAnimationOperations <T> animationOperations, bool isAccumulable) { this.animationOperations = animationOperations; this.isAccumulable = isAccumulable; KeyFrames = new FreezableCollection <KeyFrame <T> >(); KeyFrames.SetInheritanceParent(this); }
public TransformGroup() { this.matrix = Matrix.Identity; this.Children = new FreezableCollection <Transform>(); this.Children.TrySetContextParent(this); this.Children.Changed += OnChildChanged; }
public VisualStateGroup() { States = new FreezableCollection<VisualState>(); States.SetInheritanceParent(this); Transitions = new FreezableCollection<VisualTransition>(); Transitions.SetInheritanceParent(this); }
private object[] PrepareParameters(FreezableCollection <Parameter> parameters, Exception exception) { var param = new List <object>(parameters.Count + 1); parameters.ForEach(p => param.Add(p.Value)); param.Add(exception); return(param.ToArray()); }
// Constructor public TargetGroup() { instance = this; DebugProbe += DebugTrace; Targets = new FreezableCollection <FZ>(); Targets.Changed += ColFzReceiverOnChanged; }
public SearchControl() { this.InitializeComponent(); FilterOptions = new FreezableCollection <FilterOption>(); OrderOptions = new ObservableCollection <OrderOption>(); ColumnOptions = new ObservableCollection <ColumnOption>(); this.Loaded += new RoutedEventHandler(SearchControl_Loaded); }
protected ApplicationJumpItemCollection(IApplicationJumpListImplementation implementation) { if (implementation == null) { throw new ArgumentNullException("implementation"); } this.implementation = implementation; SourceItems = new FreezableCollection <ApplicationJumpItem>(); }
public Grid() { RowDefinitions = new FreezableCollection <RowDefinition>(); RowDefinitions.TrySetContextParent(this); ColumnDefinitions = new FreezableCollection <ColumnDefinition>(); ColumnDefinitions.TrySetContextParent(this); defaultRowDefinitions = new [] { new RowDefinition() }; defaultColumnDefinitions = new [] { new ColumnDefinition() }; }
public CountSearchControl() { this.InitializeComponent(); FilterOptions = new FreezableCollection <FilterOption>(); ColumnOptions = new ObservableCollection <ColumnOption>(); OrderOptions = new ObservableCollection <OrderOption>(); this.Loaded += new RoutedEventHandler(SearchControl_Loaded); this.Bind(AutomationProperties.ItemStatusProperty, this, "ItemsCount"); }
public Grid() { RowDefinitions = new FreezableCollection <RowDefinition>(); RowDefinitions.SetInheritanceParent(this); ColumnDefinitions = new FreezableCollection <ColumnDefinition>(); ColumnDefinitions.SetInheritanceParent(this); defaultRowDefinitions = new [] { new RowDefinition() }; defaultColumnDefinitions = new [] { new ColumnDefinition() }; }
public Grid() { RowDefinitions = new FreezableCollection<RowDefinition>(); RowDefinitions.SetInheritanceParent(this); ColumnDefinitions = new FreezableCollection<ColumnDefinition>(); ColumnDefinitions.SetInheritanceParent(this); defaultRowDefinitions = new [] { new RowDefinition() }; defaultColumnDefinitions = new [] { new ColumnDefinition() }; }
public Window1() { InitializeComponent(); FreezableCollection <SolidColorBrush> collection = new FreezableCollection <SolidColorBrush>(); collection.Changed += collection_Changed; SolidColorBrush brush = new SolidColorBrush(Colors.Red); collection.Add(brush); brush.Color = Colors.Blue; }
/// <summary> /// Gets the Triggers associated with a specified object. /// </summary> /// <param name="obj">The object from which to retrieve the Triggers.</param> /// <returns>A <see cref="FreezableCollection{T}"/> containing the triggers associated with the specified object.</returns> public static FreezableCollection <Triggers.Trigger> GetTriggers(DependencyObject obj) { var attachedTriggers = (FreezableCollection <Triggers.Trigger>)obj.GetValue(TriggersProperty); if (attachedTriggers == null) { attachedTriggers = new FreezableCollection <Triggers.Trigger>(); ((INotifyCollectionChanged)attachedTriggers).CollectionChanged += (_, e) => AttachedCollectionChanged(obj, e); obj.SetValue(TriggersProperty, attachedTriggers); } return(attachedTriggers); }
public SplitMenuButton() { AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(ClickEventHandler)); AddHandler(ToggleButton.CheckedEvent, new RoutedEventHandler(CheckedUncheckedEventHandler)); AddHandler(ToggleButton.UncheckedEvent, new RoutedEventHandler(CheckedUncheckedEventHandler)); AddHandler(MenuItem.ClickEvent, new RoutedEventHandler(MenuItemClickEventHandler)); Items = new FreezableCollection <DependencyObject>(); _itemsSourcePropertyChangedTracker = DeepTracker.Setup(this) .Include(Route.Create(nameof(ItemsSource))) .Include(Route.Create(nameof(Items))) .Subscribe <ObjectAttachedEventArgs>(ItemsCollectionChanged) .Create() .Activate(); }
/// <inheritdoc/> protected override object ExtendBinding(IServiceProvider serviceProvider, DependencyObject?targetObject, DependencyProperty targetProperty) { if (targetObject == null) { return(this); } UpdateBindingMode(targetObject, targetProperty); var binder = new SteppedBinder(targetObject, targetProperty, ActualBinding, SteppingDuration); FreezableCollection <TransientBinder> binders = TransientBinder.GetBinders(targetObject); binders.Add(binder); return(targetObject.GetValue(targetProperty)); }
public static FreezableCollection <UIEventProcessorBase> GetProcessors(DependencyObject obj) { var retVal = (FreezableCollection <UIEventProcessorBase>)obj.GetValue(ProcessorsProperty); if (retVal == null) { retVal = new FreezableCollection <UIEventProcessorBase>(); var ehub = new UIEventHub(new ScriptRunner(), obj as UIElement, true) { EventProcessors = retVal }; SetUIEventHub(obj, ehub); SetProcessors(obj, retVal); } return(retVal); }
public void FreezableCollectionBasicTest() { int resources1ChangedCount = 0; object resourceValue; Freezable freezable1 = new Freezable(); freezable1.ResourcesChanged += (sender, e) => resources1ChangedCount++; FreezableCollection <Freezable> freezableCollection = new FreezableCollection <Freezable> { freezable1 }; FrameworkElement element = new FrameworkElement(); element.DataContext = "data-context"; element.Resources = new ResourceDictionary(); element.Resources.Add("key1", "value1"); Assert.IsNull(freezable1.GetValue(FrameworkElement.DataContextProperty)); Assert.IsFalse(freezable1.TryGetResource("key1", out resourceValue)); element.SetValue(ValueProperty, freezableCollection); Assert.AreEqual("data-context", freezable1.GetValue(FrameworkElement.DataContextProperty)); Assert.AreEqual(2, resources1ChangedCount); Assert.IsTrue(freezable1.TryGetResource("key1", out resourceValue)); Assert.AreEqual("value1", resourceValue); Freezable freezable2 = new Freezable(); freezableCollection.Add(freezable2); Assert.AreEqual("data-context", freezable2.GetValue(FrameworkElement.DataContextProperty)); Assert.IsTrue(freezable2.TryGetResource("key1", out resourceValue)); Assert.AreEqual("value1", resourceValue); freezableCollection.Clear(); Assert.AreNotEqual("data-context", freezable1.GetValue(FrameworkElement.DataContextProperty)); Assert.AreNotEqual("data-context", freezable2.GetValue(FrameworkElement.DataContextProperty)); Assert.AreEqual(3, resources1ChangedCount); Assert.IsFalse(freezable1.TryGetResource("key1", out resourceValue)); Assert.IsFalse(freezable2.TryGetResource("key1", out resourceValue)); }
public void FreezableCollectionBasicTest() { int resources1ChangedCount = 0; object resourceValue; Freezable freezable1 = new Freezable(); freezable1.ResourcesChanged += (sender, e) => resources1ChangedCount++; FreezableCollection<Freezable> freezableCollection = new FreezableCollection<Freezable> { freezable1 }; FrameworkElement element = new FrameworkElement(); element.DataContext = "data-context"; element.Resources = new ResourceDictionary(); element.Resources.Add("key1", "value1"); Assert.IsNull(freezable1.GetValue(FrameworkElement.DataContextProperty)); Assert.IsFalse(freezable1.TryGetResource("key1", out resourceValue)); element.SetValue(ValueProperty, freezableCollection); Assert.AreEqual("data-context", freezable1.GetValue(FrameworkElement.DataContextProperty)); Assert.AreEqual(2, resources1ChangedCount); Assert.IsTrue(freezable1.TryGetResource("key1", out resourceValue)); Assert.AreEqual("value1", resourceValue); Freezable freezable2 = new Freezable(); freezableCollection.Add(freezable2); Assert.AreEqual("data-context", freezable2.GetValue(FrameworkElement.DataContextProperty)); Assert.IsTrue(freezable2.TryGetResource("key1", out resourceValue)); Assert.AreEqual("value1", resourceValue); freezableCollection.Clear(); Assert.AreNotEqual("data-context", freezable1.GetValue(FrameworkElement.DataContextProperty)); Assert.AreNotEqual("data-context", freezable2.GetValue(FrameworkElement.DataContextProperty)); Assert.AreEqual(3, resources1ChangedCount); Assert.IsFalse(freezable1.TryGetResource("key1", out resourceValue)); Assert.IsFalse(freezable2.TryGetResource("key1", out resourceValue)); }
public void VisualStateParseTest() { string text = @" <FrameworkElement xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name='CommonStates'> <VisualStateGroup.Transitions> <VisualTransition To='Pressed' /> </VisualStateGroup.Transitions> <VisualState x:Name='Normal' /> <VisualState x:Name='MouseOver'> <Storyboard> </Storyboard> </VisualState> <VisualState x:Name='Pressed'> <Storyboard> </Storyboard> </VisualState> <VisualState x:Name='Disabled'> <Storyboard> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </FrameworkElement>"; XamlElement rootElement = XamlParser.Parse(text); FrameworkElement element = XamlLoader.Load(rootElement) as FrameworkElement; FreezableCollection <VisualStateGroup> list = VisualStateManager.GetVisualStateGroups(element); Assert.AreEqual(1, list.Count); Assert.AreEqual(1, list[0].Transitions.Count); Assert.AreEqual(4, list[0].States.Count); Assert.AreEqual("CommonStates", list[0].Name); Assert.AreEqual("Normal", list[0].States[0].Name); }
bool ShouldUpdateInternalItems() { if (!IsAttached) { return(false); } TaskbarThumbButtonInfoCollection collection = ThumbButtonInfos; FreezableCollection <TaskbarThumbButtonInfo> collection2 = GetInternalItems(this); if (collection.Count != collection2.Count) { return(true); } for (int i = 0; i < collection.Count; i++) { var item1 = collection[i]; var item2 = collection2[i]; if (item1 != item2) { return(true); } } return(false); }
public void FreezableCollectionBasicTest() { int resources1ChangedCount = 0; object resourceValue; Freezable freezable1 = new Freezable(); freezable1.ResourcesChanged += (sender, e) => resources1ChangedCount++; FreezableCollection <Freezable> freezableCollection = new FreezableCollection <Freezable> { freezable1 }; FrameworkElement element = new FrameworkElement(); element.Resources = new ResourceDictionary(); element.Resources.Add("key1", "value1"); Assert.IsFalse(freezable1.TryGetResource("key1", out resourceValue)); freezableCollection.TrySetContextParent(element); Assert.AreEqual(1, resources1ChangedCount); Assert.IsTrue(freezable1.TryGetResource("key1", out resourceValue)); Assert.AreEqual("value1", resourceValue); Freezable freezable2 = new Freezable(); freezableCollection.Add(freezable2); Assert.IsTrue(freezable2.TryGetResource("key1", out resourceValue)); Assert.AreEqual("value1", resourceValue); freezableCollection.Clear(); Assert.AreEqual(2, resources1ChangedCount); Assert.IsFalse(freezable1.TryGetResource("key1", out resourceValue)); Assert.IsFalse(freezable2.TryGetResource("key1", out resourceValue)); }
public ViewServiceProvider() { Services = new FreezableCollection <FreezableViewService>(); }
private object[] PrepareParameters(FreezableCollection<Parameter> parameters, Exception exception) { var param = new List<object>(parameters.Count + 1); parameters.ForEach(p => param.Add(p.Value)); param.Add(exception); return param.ToArray(); }
private HRESULT _UpdateThumbButtons(bool attached) { THUMBBUTTON[] array = new THUMBBUTTON[7]; HRESULT result = this._RegisterThumbButtons(); if (result.Failed) { return(result); } ThumbButtonInfoCollection thumbButtonInfos = this.ThumbButtonInfos; HRESULT result2; try { uint num = 0u; if (!attached || thumbButtonInfos == null) { goto IL_1AE; } using (FreezableCollection <ThumbButtonInfo> .Enumerator enumerator = thumbButtonInfos.GetEnumerator()) { while (enumerator.MoveNext()) { ThumbButtonInfo thumbButtonInfo = enumerator.Current; THUMBBUTTON thumbbutton = new THUMBBUTTON { iId = num, dwMask = (THB.ICON | THB.TOOLTIP | THB.FLAGS) }; switch (thumbButtonInfo.Visibility) { case Visibility.Visible: goto IL_A5; case Visibility.Hidden: thumbbutton.dwFlags = (THBF.DISABLED | THBF.NOBACKGROUND); thumbbutton.hIcon = IntPtr.Zero; break; case Visibility.Collapsed: thumbbutton.dwFlags = THBF.HIDDEN; break; default: goto IL_A5; } IL_146: array[(int)((UIntPtr)num)] = thumbbutton; num += 1u; if (num != 7u) { continue; } break; IL_A5: thumbbutton.szTip = (thumbButtonInfo.Description ?? ""); thumbbutton.hIcon = this._GetHICONFromImageSource(thumbButtonInfo.ImageSource, this._overlaySize); if (!thumbButtonInfo.IsBackgroundVisible) { thumbbutton.dwFlags |= THBF.NOBACKGROUND; } if (!thumbButtonInfo.IsEnabled) { thumbbutton.dwFlags |= THBF.DISABLED; } else { thumbbutton.dwFlags = thumbbutton.dwFlags; } if (!thumbButtonInfo.IsInteractive) { thumbbutton.dwFlags |= THBF.NONINTERACTIVE; } if (thumbButtonInfo.DismissWhenClicked) { thumbbutton.dwFlags |= THBF.DISMISSONCLICK; goto IL_146; } goto IL_146; } goto IL_1AE; } IL_179: array[(int)((UIntPtr)num)] = new THUMBBUTTON { iId = num, dwFlags = (THBF.DISABLED | THBF.NOBACKGROUND | THBF.HIDDEN), dwMask = (THB.ICON | THB.TOOLTIP | THB.FLAGS) }; num += 1u; IL_1AE: if (num < 7u) { goto IL_179; } result2 = this._taskbarList.ThumbBarUpdateButtons(this._hwndSource.Handle, (uint)array.Length, array); } finally { foreach (THUMBBUTTON thumbbutton2 in array) { IntPtr hIcon = thumbbutton2.hIcon; if (IntPtr.Zero != hIcon) { Utility.SafeDestroyIcon(ref hIcon); } } } return(result2); }
internal static void SetInternalItems(TaskbarButtonService obj, FreezableCollection <TaskbarThumbButtonInfo> value) { obj.SetValue(InternalItemsProperty, value); }
static void SetInternalItems(DependencyObject obj, FreezableCollection<ApplicationJumpItem> value) { obj.SetValue(InternalItemsProperty, value); }
public static void SetVisualStateGroups(DependencyObject obj, FreezableCollection<VisualStateGroup> value) { obj.SetValue(VisualStateGroupsProperty, value); }
public SearchControl() { this.InitializeComponent(); FilterOptions = new FreezableCollection<FilterOption>(); OrderOptions = new ObservableCollection<OrderOption>(); ColumnOptions = new ObservableCollection<ColumnOption>(); this.Loaded += new RoutedEventHandler(SearchControl_Loaded); }
static void SetInternalItems(DependencyObject obj, FreezableCollection <ApplicationJumpItem> value) { obj.SetValue(InternalItemsProperty, value); }
/// <summary> /// Initializes a new instance of the <see cref="MetaEntityFlexible"/> class. /// </summary> public MetaEntityFlexible() { this._PropertyByIndex = new FreezableCollection <IMetaIndexedProperty>(); this._PropertyByName = new FreezableDictionary <string, IMetaIndexedProperty>(); }
/// <summary> /// Initializes a new instance of the SystemMenuWindow class. /// </summary> public TitleBarHelperClass() { this.Loaded += this.SystemMenuWindow_Loaded; this.MenuItems = new FreezableCollection <SystemMenuItem>(); }
internal static void SetInternalItems(TaskbarButtonService obj, FreezableCollection<TaskbarThumbButtonInfo> value) { obj.SetValue(InternalItemsProperty, value); }
public Current() { TypeOverrides = new FreezableCollection<Type>(); Commands = new FreezableCollection<Command>(); }
static void SetInternalItems(DependencyObject obj, FreezableCollection<TaskbarThumbButtonInfo> value) { obj.SetValue(InternalItemsProperty, value); }
/// <summary> /// Initializes a new instance of the SystemMenuWindow class. /// </summary> public SystemMenuWindow() { Loaded += SystemMenuWindow_Loaded; MenuItems = new FreezableCollection <SystemMenuItem>(); }
public CountSearchControl() { this.InitializeComponent(); FilterOptions = new FreezableCollection<FilterOption>(); ColumnOptions = new ObservableCollection<ColumnOption>(); OrderOptions = new ObservableCollection<OrderOption>(); this.Loaded += new RoutedEventHandler(SearchControl_Loaded); this.Bind(AutomationProperties.ItemStatusProperty, this, "ItemsCount"); }
public ModelConstraint() { this._Properties = new FreezableCollection <ModelProperty>(); }