当前位置: 首页>>代码示例>>C#>>正文


C# UIElement.SetValue方法代码示例

本文整理汇总了C#中Windows.UI.Xaml.UIElement.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# UIElement.SetValue方法的具体用法?C# UIElement.SetValue怎么用?C# UIElement.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Windows.UI.Xaml.UIElement的用法示例。


在下文中一共展示了UIElement.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetEdge

 public static void SetEdge(UIElement element, Edge edge)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     element.SetValue(EdgeProperty, edge);
 }
开发者ID:siatwangmin,项目名称:WinRTXamlToolkit,代码行数:8,代码来源:EdgePanel.cs

示例2: SetBindings

        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);
        }
开发者ID:aaronpowell,项目名称:Bob,代码行数:11,代码来源:EventBinder.cs

示例3: GetBindings

        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;
        }
开发者ID:aaronpowell,项目名称:Bob,代码行数:12,代码来源:VisualStateBinder.cs

示例4: SetShowScrollbarAtBreakpointOffset

 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;
     }
 }
开发者ID:Mordonus,项目名称:MALClient,代码行数:14,代码来源:ScrollViewerExtensions.cs

示例5: SetLoadMore

 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);
             }
         };
     }
 }
开发者ID:Korshunoved,项目名称:Win10reader,代码行数:18,代码来源:ScrollViewerIncremental.cs

示例6: ReInitAccentColorChanged

 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);
         }
     }
 }
开发者ID:h82258652,项目名称:SoftwareKobo.UniversalToolkit,代码行数:24,代码来源:ColorExtensions.cs

示例7: SetHelpText

 /// <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);
 }
开发者ID:JoergNeumann,项目名称:HelpFrame,代码行数:9,代码来源:HelpFrame.cs

示例8: SetSectionTemplate

 public static void SetSectionTemplate(UIElement element, DataTemplate value)
 {
     element.SetValue(SectionTemplateProperty, value);
 }
开发者ID:Confuset,项目名称:7Pass-Remake,代码行数:4,代码来源:HubBinder.cs

示例9: SetAlignment

 /// <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);
 }
开发者ID:JoergNeumann,项目名称:HelpFrame,代码行数:9,代码来源:HelpFrame.cs

示例10: SetBitmapImageSource

 public static void SetBitmapImageSource(UIElement element, BitmapImage value)
 {
     element.SetValue(FileProperty, value);
 }
开发者ID:Snail34,项目名称:MobileScanner,代码行数:4,代码来源:ImageExtensions1.cs

示例11: SetHeaderTemplate

 public static void SetHeaderTemplate(UIElement element, DataTemplate value)
 {
     element.SetValue(HeaderTemplateProperty, value);
 }
开发者ID:Confuset,项目名称:7Pass-Remake,代码行数:4,代码来源:HubBinder.cs

示例12: SetLayer

 /// <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);
 }
开发者ID:JoergNeumann,项目名称:HelpFrame,代码行数:9,代码来源:HelpFrame.cs

示例13: SetIsTiltEnabled

 /// <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);
 }
开发者ID:RareNCool,项目名称:MyToolkit,代码行数:7,代码来源:TiltEffect.cs

示例14: SetRotateLeft

 public static void SetRotateLeft(UIElement element, CompositeTransform value)
 {
     element.SetValue(RotateProperty, value);
 }
开发者ID:Snail34,项目名称:MobileScanner,代码行数:4,代码来源:RotateExtensions.cs

示例15: SetWidth

 public static void SetWidth(UIElement element, double value)
 {
     element.SetValue(WidthProperty, value);
 }
开发者ID:DrNorton,项目名称:TrineTimeTable,代码行数:4,代码来源:RelativeSize.cs


注:本文中的Windows.UI.Xaml.UIElement.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。