public static void SetEdge(UIElement element, Edge edge) { if (element == null) { throw new ArgumentNullException("element"); } element.SetValue(EdgeProperty, edge); }
public static void SetBindings(UIElement element, ObservableCollection<EventBinding> value) { var existingCollection = (ObservableCollection<EventBinding>)element.GetValue(BindingsProperty); if (existingCollection != null) existingCollection.Clear(); //Cause all existing bound events to be unbound if (value != null) value.CollectionChanged += (s, e) => OnCollectionChanged(e, element); element.SetValue(BindingsProperty, value); }
public static VisualStateBindingCollection GetBindings(UIElement element) { var bindingCollection = element.GetValue(BindingsProperty) as VisualStateBindingCollection; if (bindingCollection == null) { bindingCollection = new VisualStateBindingCollection(); element.SetValue(BindingsProperty, bindingCollection); } return bindingCollection; }
public static void SetShowScrollbarAtBreakpointOffset(UIElement element, double value) { element.SetValue(ShowScrollbarAtBreakpointOffsetProperty, value); if (value > 0) { var sv = (ScrollViewer) element; sv.ViewChanging += SvOnViewChanging; } else { var sv = (ScrollViewer)element; sv.ViewChanging -= SvOnViewChanging; } }
public static void SetLoadMore(UIElement element, EventHandler value) { element.SetValue(LoadMoreProperty, value); var sv = element as ScrollViewer; if (sv != null) { sv.ViewChanged += (sender, args) => { var verticalOffsetValue = sv.VerticalOffset; var maxVerticalOffsetValue = sv.ExtentHeight - sv.ViewportHeight; if (maxVerticalOffsetValue < 0 || Math.Abs(verticalOffsetValue - maxVerticalOffsetValue) < 1.0) { value.Invoke(sv, EventArgs.Empty); } }; } }
internal static void ReInitAccentColorChanged() { if (_currentListenElement != null && _listenToken.HasValue) { _currentListenElement.UnregisterPropertyChangedCallback(SolidColorBrush.ColorProperty, _listenToken.Value); } if (_currentListenElement == null) { _currentListenElement = Window.Current.Content; if (_currentListenElement != null) { var accentColorBrush = (SolidColorBrush)XamlReader.Load("<SolidColorBrush xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" Color=\"{ThemeResource SystemAccentColor}\" />"); _listenToken = accentColorBrush.RegisterPropertyChangedCallback(SolidColorBrush.ColorProperty, (obj, dp) => { if (AccentColorChanged != null) { var accentColor = (Color)obj.GetValue(dp); AccentColorChanged(obj, accentColor); } }); _currentListenElement.SetValue(AccentColorBrushProperty, accentColorBrush); } } }
/// <summary> /// Sets the help text of the attached element. /// </summary> /// <param name="element">UIElement instance.</param> /// <param name="helpText">Help text.</param> public static void SetHelpText(UIElement element, string helpText) { element.SetValue(HelpFrame.HelpTextProperty, helpText); }
public static void SetSectionTemplate(UIElement element, DataTemplate value) { element.SetValue(SectionTemplateProperty, value); }
/// <summary> /// Sets a value indicating the alignment of the help frame on top of the associated element. /// </summary> /// <param name="element">Associated element.</param> /// <param name="value">Value of the HelpFrameAlignment enumeration.</param> public static void SetAlignment(UIElement element, HelpFrameAlignment value) { element.SetValue(AlignmentProperty, value); }
public static void SetBitmapImageSource(UIElement element, BitmapImage value) { element.SetValue(FileProperty, value); }
public static void SetHeaderTemplate(UIElement element, DataTemplate value) { element.SetValue(HeaderTemplateProperty, value); }
/// <summary> /// Sets the internal HelpLayer instance to attach to the root layout panel of the page. /// </summary> /// <param name="element">UIElement element.</param> /// <param name="value">HelpLayer instance.</param> private static void SetLayer(UIElement element, HelpLayer value) { element.SetValue(LayerProperty, value); }
/// <summary>Sets a value indicating whether to enable tilt effect for the <see cref="UIElement"/>. </summary> /// <param name="element">The element. </param> /// <param name="value">The value. </param> public static void SetIsTiltEnabled(UIElement element, bool value) { element.SetValue(IsTiltEnabledProperty, value); }
public static void SetRotateLeft(UIElement element, CompositeTransform value) { element.SetValue(RotateProperty, value); }
public static void SetWidth(UIElement element, double value) { element.SetValue(WidthProperty, value); }
public static void SetTargetItemWidth(UIElement element, int value) { element.SetValue(TargetItemWidthProperty, value); }
public static void SetItemsSourceBinding(UIElement element, IEnumerable value) { element.SetValue(ItemsSourceBindingProperty, value); }
public static void SetCommand(UIElement element, ICommand command) { element.SetValue(CommandProperty, command); }
/// <summary> /// Setzt einen Wert, der angibt ob das Margin des Rings im Codebehind gesetzt werden soll. /// </summary> /// <param name="element">Eine instanz von <see cref="Koopakiller.RadialSlider"/></param> /// <param name="value">Der zu setzende Wert für die Eigenschaft.</param> public static void SetUseCodeMargin(UIElement element, Boolean value) { element.SetValue(UseCodeMarginProperty, value); }
public static void SetIsLoading(UIElement element, Boolean value) { element.SetValue(IsLoadingProperty, value); }
/// <summary> /// Sets a value indicating if the help layer is displayed. /// </summary> /// <param name="element">UIElement element.</param> /// <param name="value">True to display the layer, otherwise false.</param> public static void SetShowBackgroundLayer(UIElement element, bool value) { element.SetValue(ShowBackgroundLayerProperty, value); }
public static void SetDock(UIElement element, Dock dock) { if (element == null) { throw new ArgumentNullException("element"); } element.SetValue(DockProperty, dock); }
/// <summary> /// Sets a value indicating if the help layer is displayed. /// </summary> /// <param name="element">UIElement instance.</param> /// <param name="value">True if the help layer is displayed.</param> public static void SetShowHelp(UIElement element, bool value) { element.SetValue(ShowHelpProperty, value); }
public static void SetDock(UIElement obj, Dock value) { obj.SetValue(DockProperty, value); }
public static void SetImageId(UIElement element, object value) { element.SetValue(ImageIdProperty, value); }
public static void SetDataSource(UIElement element, object value) { element.SetValue(DataSourceProperty, value); }
public static void SetContainer(UIElement element, FrameworkElement value) { element.SetValue(ContainerProperty, value); }
private static void SetHoldListener(UIElement element, HoldListener value) { element.SetValue(HoldListenerProperty, value); }
//Effect public static void SetEffect(UIElement element, ICompositionEffect value) { element.SetValue(EffectProperty, value); }
public static void SetHideMoreButton(UIElement element, bool value) { if (element == null) throw new ArgumentNullException(nameof(element)); element.SetValue(HideMoreButtonProperty, value); }