當前位置: 首頁>>代碼示例>>C#>>正文


C# Xaml.DependencyPropertyChangedEventArgs類代碼示例

本文整理匯總了C#中Windows.UI.Xaml.DependencyPropertyChangedEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# DependencyPropertyChangedEventArgs類的具體用法?C# DependencyPropertyChangedEventArgs怎麽用?C# DependencyPropertyChangedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DependencyPropertyChangedEventArgs類屬於Windows.UI.Xaml命名空間,在下文中一共展示了DependencyPropertyChangedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EffectChanged

        private static void EffectChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var uiSender = d as UIElement;
            var effect = e.NewValue as IComposition;

            effect.Initialize(uiSender);
        }
開發者ID:juanpaexpedite,項目名稱:Universal,代碼行數:7,代碼來源:CompositionExtensions.cs

示例2: OnMessageChanged

 private static void OnMessageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     var notifybar = d as NotificationBar;
     var message = e.NewValue as string;
     if (message == string.Empty) return;
     notifybar?.ShowMessage(message);
 }
開發者ID:startewho,項目名稱:CnBetaUWA,代碼行數:7,代碼來源:NotificationBar.cs

示例3: SizeChanged

        private static async void SizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
            if ((int)e.NewValue <= 0)
                throw new ArgumentException("ThumbImageSource width/height 必須大於0");

            var thumb = (ThumbImageSource)d;
            //await thumb.Deal();
        }
開發者ID:gruan01,項目名稱:Lagou.UWP,代碼行數:7,代碼來源:ThumbImageSource.cs

示例4: OnSourceChanged

 // 依存関係プロパティに値がセットされたときに呼び出されるメソッド
 private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     var i = d as TwitterSuggestTextBox;
     i.textBoxTweet.Text = (string)e.NewValue;
    // i.model.Text = (string)e.NewValue;
     
 }
開發者ID:garicchi,項目名稱:Neuronia,代碼行數:8,代碼來源:TwitterSuggestTextBox.xaml.cs

示例5: OnMaskChanged

 private static void OnMaskChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
 {
     var target = (TextBoxMaskBehavior)sender;
     var oldMask = (TextMask)e.OldValue;
     var newMask = (TextMask)e.NewValue;
     target.OnMaskChanged(oldMask, newMask);
 }
開發者ID:fubar-coder,項目名稱:bifrost.xaml,代碼行數:7,代碼來源:TextBoxMaskBehavior.cs

示例6: OnHeaderTemplatePropertyChanged

 private static void OnHeaderTemplatePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     var source = d as HeaderedItemsControl;
     var oldHeaderTemplate = e.OldValue as DataTemplate;
     var newHeaderTemplate = e.NewValue as DataTemplate;
     if (source != null) source.OnHeaderTemplateChanged(oldHeaderTemplate, newHeaderTemplate);
 }
開發者ID:nor0x,項目名稱:UWP_Expander,代碼行數:7,代碼來源:HeaderedItemsControl.cs

示例7: PositionChanged

 static void PositionChanged(DependencyObject dp, DependencyPropertyChangedEventArgs args)
 {
     var p = ((FrameworkElement)dp)?.Parent;
     if (p == null)
         return;
     ((UIElement)p)?.InvalidateArrange();
 }
開發者ID:NotExperiencedDev,項目名稱:AmP3,代碼行數:7,代碼來源:SimpleWorld.cs

示例8: OnBaterryPercentagePropertyChanged

        private static void OnBaterryPercentagePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var obj = (BatteryPercentageTrigger)d;
            var val = (BaterryPercentageState)e.NewValue;

            obj.SetActive(val == _batteryPercentageState);
        }
開發者ID:rwecho,項目名稱:UAP-Samples,代碼行數:7,代碼來源:BatteryPercentageTrigger.cs

示例9: OnRatioVisibleChanged

 /// <summary>
 /// RatioVisibleProperty property changed handler.
 /// </summary>
 /// <param name="d">PartialView that changed its RatioVisible.</param>
 /// <param name="e">Event arguments.</param>
 private static void OnRatioVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     Clipper source = (Clipper)d;
     double oldValue = (double)e.OldValue;
     double newValue = (double)e.NewValue;
     source.OnRatioVisibleChanged(oldValue, newValue);
 }
開發者ID:jleft,項目名稱:callisto,代碼行數:12,代碼來源:Clipper.cs

示例10: OnExpandDirectionChanged

 /// <summary>
 /// ExpandDirectionProperty property changed handler.
 /// </summary>
 /// <param name="d">ExpandDirectionView that changed its ExpandDirection.</param>
 /// <param name="e">Event arguments.</param>
 private static void OnExpandDirectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     LinearClipper source = (LinearClipper)d;
     ExpandDirection oldValue = (ExpandDirection)e.OldValue;
     ExpandDirection newValue = (ExpandDirection)e.NewValue;
     source.OnExpandDirectionChanged(oldValue, newValue);
 }
開發者ID:sk8tz,項目名稱:callisto,代碼行數:12,代碼來源:LinearClipper.cs

示例11: OnSearchTermChanged

        private static void OnSearchTermChanged(DependencyObject d, DependencyPropertyChangedEventArgs args) {
            var textBlock = (TextBlock)d;
            if (textBlock == null) return;

            var searchTerm = GetSearchTerm(textBlock);
            var originalText = GetSearchText(textBlock);
            if (string.IsNullOrEmpty(originalText) || (searchTerm == null)) return;
            if (searchTerm.Length == 0) {
                textBlock.Text = originalText;
                return;
            }

            textBlock.Inlines.Clear();
            var currentIndex = 0;
            var searchTermLength = searchTerm.Length;
            int index = originalText.IndexOf(searchTerm, 0, StringComparison.CurrentCultureIgnoreCase);
            while (index > -1) {
                textBlock.Inlines.Add(new Run() { Text = originalText.Substring(currentIndex, index - currentIndex) });
                currentIndex = index + searchTermLength;
                textBlock.Inlines.Add(new Run() { Text = originalText.Substring(index, searchTermLength), Foreground = GetHighlightBrush(textBlock) });
                index = originalText.IndexOf(searchTerm, currentIndex, 0, StringComparison.CurrentCultureIgnoreCase);
            }

            textBlock.Inlines.Add(new Run() { Text = originalText.Substring(currentIndex) });
        }
開發者ID:ronlemire2,項目名稱:PrismRT-CodeGen-v2.1,代碼行數:25,代碼來源:HighlightSearchBehavior.cs

示例12: OnSecondsChanged

 private static void OnSecondsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
 {
     var target = (CountdownControl)sender;
     var oldSeconds = (int)e.OldValue;
     var newSeconds = (int)e.NewValue;
     target.OnSecondsChanged(oldSeconds, newSeconds);
 }
開發者ID:siatwangmin,項目名稱:WinRTXamlToolkit,代碼行數:7,代碼來源:CountdownControl.xaml.cs

示例13: OnButtonForegroundColorPropertyChanged

 private static void OnButtonForegroundColorPropertyChanged(DependencyObject d,
     DependencyPropertyChangedEventArgs e)
 {
     var color = (Color)e.NewValue;
     var titleBar = ApplicationView.GetForCurrentView().TitleBar;
     titleBar.ButtonForegroundColor = color;
 }
開發者ID:MichaelAi,項目名稱:Aural-Player,代碼行數:7,代碼來源:TitleBarPage.cs

示例14: HtmlChanged

        /// <summary>
        /// Handles the HTML has changed, converts it and attach to the attached RichTextBlock.
        /// </summary>
        /// <param name="d">The RichTextBlock.</param>
        /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static async void HtmlChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichTextBlock richText = d as RichTextBlock;
            string html = e.NewValue as string;

            if (richText != null && !string.IsNullOrEmpty(html))
            {
                try
                {
                    if (!ContainsHtmlTags(html))
                    {
                        html = html.Replace("\r\n", "<br/>");
                        html = html.Replace("\n\r", "<br/>");
                        html = html.Replace("\n", "<br/>");
                    }

                    string xaml = await Html2XamlProcessor.ConvertToXaml(html);
                    ChangeRichTextBlockContents(richText, xaml);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                    try
                    {
                        ChangeRichTextBlockContents(richText, GetErrorXaml(ex, html));
                    }
                    catch
                    {
                        Debug.WriteLine(ex);
                    }
                }
            }
        }
開發者ID:ridomin,項目名稱:waslibs,代碼行數:38,代碼來源:RichTextBlockProperties.cs

示例15: OnPathChanged

        private static void OnPathChanged( DependencyObject obj, DependencyPropertyChangedEventArgs args )
        {
            var icon = (Icon) obj;
            var data = (string) args.NewValue;

            if ( data == null )
            {
                return;
            }

            // Copy it since sharing it isn't permitted
            var path = (Path) XamlReader.Load( "<Path xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" Data=\"" + data + "\" />" );

            path.Stretch = Stretch.Uniform;
            path.HorizontalAlignment = HorizontalAlignment.Center;
            path.VerticalAlignment = VerticalAlignment.Center;
            path.SetBinding( Path.FillProperty, new Binding { Source = icon, Path = new PropertyPath( "Foreground" ) } );
            path.SetBinding( Path.MarginProperty, new Binding { Source = icon, Path = new PropertyPath( "Padding" ) } );

            var container = new Border
            {
                Child = path
            };
            container.SetBinding( Border.WidthProperty, new Binding { Source = icon, Path = new PropertyPath( "IconWidth" ) } );
            container.SetBinding( Border.HeightProperty, new Binding { Source = icon, Path = new PropertyPath( "IconHeight" ) } );
            container.SetBinding( Border.BackgroundProperty, new Binding { Source = icon, Path = new PropertyPath( "Background" ) } );

            icon.HorizontalAlignment = HorizontalAlignment.Center;
            icon.VerticalAlignment = VerticalAlignment.Center;
            icon.Content = new Viewbox
            {
                Child = container
            };
        }
開發者ID:ValentinMinder,項目名稱:pocketcampus,代碼行數:34,代碼來源:Icon.cs


注:本文中的Windows.UI.Xaml.DependencyPropertyChangedEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。