• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Media.Brush类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Brush类属于Windows.UI.Xaml.Media命名空间,在下文中一共展示了Brush类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LogMessage

 public LogMessage(string title, string description = null, bool isError = false)
 {
     TimeStamp = DateTime.Now;
     Title = title;
     Description = description;
     Foreground = new SolidColorBrush(isError ? Colors.Red : Colors.White);
 }
开发者ID:KonstantinKolesnik,项目名称:EcosHub,代码行数:7,代码来源:ProfilesBackupPage.xaml.cs


示例2: Convert

 // Implement IDateToBrushConverter.
 // This method is used to change Forground & Background color of CalendarItem
 public Brush Convert(DateTime dateTime, bool isSelected, Brush defaultValue, BrushType brushType)
 {
     if (brushType == BrushType.Background)
     {
         if (CalDates != null && CalDates.Where(one => one.CalendarItemDate.Date == dateTime.Date).Any() && !isSelected)
         {
             return new SolidColorBrush(Colors.Blue);
         }
         else
         {
             return defaultValue;
         }
     }
     else
     {
         if (CalDates != null && CalDates.Where(one => one.CalendarItemDate.Date == dateTime.Date).Any() && !isSelected)
         {
             return new SolidColorBrush(Colors.Red);
         }
         else
         {
             return defaultValue;
         }
     }
 }
开发者ID:aruyc,项目名称:WP_github,代码行数:27,代码来源:MainViewModel.cs


示例3: SetHighlightBrush

        public static void SetHighlightBrush(DependencyObject sender, Brush highlightBrush) {
            if (sender == null) {
                return;
            }

            sender.SetValue(HighlightBrushProperty, highlightBrush);
        }
开发者ID:ronlemire2,项目名称:PrismRT-CodeGen-v2.1,代码行数:7,代码来源:HighlightSearchBehavior.cs


示例4: CellColor

 public CellColor(Brush fill, Brush group, Brush star)
 {
     FillColor = fill;
     GroupColor = group;
     StarColor = star;
     BorderColor = star;
 }
开发者ID:vbenkevich,项目名称:TestGame,代码行数:7,代码来源:CellColor.cs


示例5: Series

 public Series(Grid container, double margin, DataItemCollection dataItem,Brush palette)
 {
     this._container = container;
     this._ItemSource = dataItem;
     this.margin = margin;
     this._palette = palette;
 }
开发者ID:stavrianosy,项目名称:BudgetManagementAssistant,代码行数:7,代码来源:Series.cs


示例6: SetHeaderForeground

        public static void SetHeaderForeground(DependencyObject obj, Brush value)
        {
            if (obj == null)
                throw new ArgumentNullException(nameof(obj));

            obj.SetValue(HeaderForegroundProperty, value);
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:7,代码来源:SettingsPaneInfo.cs


示例7: InventariumFlyout

        /// <summary>
        /// Create an InventariumFlyout.
        /// </summary>
        /// <param name="foreground">The color of Text and Border, NOTE: the BackButton color binds to the ApplicationTextBrush, so it's best to stick to that too.</param>
        /// <param name="background">Color of Background.</param>
        /// <param name="title">Header/Title</param>
        /// <param name="dimension">Width -> Narrow of Wide</param>
        /// <param name="url">url to open in browser.</param>
        /// <param name="image">optional: display an image next to the header</param>
        public InventariumFlyout(
            Brush foreground,
            Brush background,
            string title,
            FlyoutDimension dimension,
            string url,
            BitmapImage image = null)
        {
            this.InitializeComponent();
            this.Dimension = dimension;
            //to handle app activation -> close
            Window.Current.Activated += OnWindowActivated;
            //prepare the frame
            mainBorder.Width = (int)dimension;
            mainBorder.Height = Window.Current.Bounds.Height;
            //fill in the content
            flyoutTitle.Text = title;
            //contentPanel.Children.Add(content);
            smallImage.Source = image;
            //brush the controls according to the parameters
            mainBorder.BorderBrush = foreground;
            flyoutTitle.Foreground = foreground;
            mainFrame.Background = background;

            progressRing.IsActive = true;
            webView.LoadCompleted += OnWebViewOnLoadCompleted;

            webView.Navigate(new Uri(url));
        }
开发者ID:kailash2812,项目名称:inventarium.windows8.sdk,代码行数:38,代码来源:InventariumFlyout.xaml.cs


示例8: Show

        public async static void Show(string message, string title, Brush foregroundTextBrush, Brush countdownBackgroundBrush, double timeToLive, bool autoHide = false, double width = 300, double height = 180,  string metroIcon = "", string imageIcon = "", double scaleIcon = 1)
        {

            if (NotificationService._rootControl != null && message != null)
            {
                DispatchedHandler invokedHandler = new DispatchedHandler(() =>
                {
                    if (NotificationService._rootControl == null) //|| MsgBoxService._rootControl.Visibility == Visibility.Visible)
                    {
                        return;
                    }
                    NotificationService._rootControl.Visibility = Visibility.Visible;
                    NotificationView view = new NotificationView(message, "", autoHide, timeToLive, metroIcon, imageIcon: imageIcon, scaleIcon: scaleIcon);
                    view.Width = width;
                    view.Height = height;
                    view.Margin = new Thickness(3);
                    //view.HorizontalAlignment = horizontalAlignment;
                    //view.VerticalAlignment = VerticalAlignment.Top;
                    
                    view.MessageTextForegroundColor = foregroundTextBrush;
                    view.CountdownBackgroundColor = countdownBackgroundBrush;
                    view.Show();
                    view.OnClosing += new EventHandler(NotificationService.view_OnClosing);

                    NotificationService._MsgboxContainer.Children.Insert(0, view);
                    
                });
                await NotificationService._rootControl.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, invokedHandler);
            }
        }
开发者ID:liquidboy,项目名称:X,代码行数:30,代码来源:NotificationService.cs


示例9: EnqueueItem

        public static void EnqueueItem(UIElement content, Action<bool> submitAction, Brush bgBrush, bool tappable, TimeSpan timeout, bool showCloseButton)
        {
            if (_lastUsedInstance == null)
                return;

            _lastUsedInstance._notificationQueue.Enqueue(new NotificationItem(content, bgBrush, submitAction, tappable, timeout, showCloseButton));
            _lastUsedInstance.TryDequeue();
        }
开发者ID:haroldma,项目名称:Toasts.Forms.Plugin,代码行数:8,代码来源:ToastPromptsHostControl.cs


示例10: NavigationItem

 public NavigationItem(string id, Symbol symbol, string caption, IEnumerable<NavigationItem> subItems, Brush color = null, Brush background = null) : this(id, symbol, caption, color)
 {
     this.SubItems = subItems;
     if (background != null)
     {
         this.Background = background;
     }
 }
开发者ID:ridomin,项目名称:waslibs,代码行数:8,代码来源:NavigationItem.cs


示例11: DrawEllipse

		public void DrawEllipse (Rect frame, Pen pen = null, Brush brush = null)
		{
			var ch = GetChild (ChildType.Ellipse);
			var s = (Shapes.Rectangle)ch.Shape;
			s.Width = frame.Width;
			s.Height = frame.Height;
			FormatShape (s, pen, brush);
		}
开发者ID:michaelstonis,项目名称:NGraphics,代码行数:8,代码来源:CanvasCanvas.cs


示例12: Overlay

        public Overlay(Image imageControl, Rect rect)
        {
            _Parent = (Grid)imageControl.Parent;
            _Rectangle = rect;

            _Transparent = new SolidColorBrush(Colors.Transparent);
            _Red = new SolidColorBrush(Colors.Red);
        }
开发者ID:drewdz,项目名称:BarcodeScanner,代码行数:8,代码来源:Overlay.cs


示例13: TextBoxCueBanner

        public TextBoxCueBanner()
        {
            this.DefaultStyleKey = typeof(TextBox);

            CueBannerState = true;
            CueBannerActiveBrush = this.BorderBrush;
            CueBannerInactiveBrush = this.Foreground;
        }
开发者ID:EddyBeaupre,项目名称:searchIEEE,代码行数:8,代码来源:TextBoxCueBanner.cs


示例14: ChartControl

		public ChartControl()
		{
			this.DataPointCount = DefaultDatapoints;

			this.chartColor = new SolidColorBrush(Windows.UI.Color.FromArgb(0xFF, 0xDD, 0xFF, 0xDD));

			DrawBackground();
		}
开发者ID:LarryPavanery,项目名称:Windows-nRF-Toolbox,代码行数:8,代码来源:ChartControl.cs


示例15: BulletNPC

        public BulletNPC(Position basePosition, double angle, int x, int y): base(x, y)
        {
            this.basePosition = basePosition;
            this.angle = angle;

            this.image = new BitmapImage();
            this.brush = setBrush();
            this.Size = 20;
        }
开发者ID:BilelAvans,项目名称:BallDrive,代码行数:9,代码来源:BulletNPC.cs


示例16: lstColorPalette_SelectionChanged

 private void lstColorPalette_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ColorPickerBrush objColor = (ColorPickerBrush)lstColorPalette.SelectedItem;
     if (ColorSelectedEvent != null)
     {
         SelectedColor = objColor.ColorBrush;
         ColorSelectedEvent(this, EventArgs.Empty);
     }
 }
开发者ID:dinhchitrung,项目名称:winrt-custom-controls,代码行数:9,代码来源:CustomColorPicker.xaml.cs


示例17: MainPage

 public MainPage()
 {
     this.InitializeComponent();
     currentRatio = AspectRatioType.ratio_4_3;
     selectedBrush = new SolidColorBrush(Windows.UI.Colors.CadetBlue);
     unselectedBrush = new SolidColorBrush(Windows.UI.Colors.DarkGray);
     updateButtons();
     updateRightText();
 }
开发者ID:sugendran,项目名称:win8-aspect-ratio,代码行数:9,代码来源:MainPage.xaml.cs


示例18: Attach

 public void Attach(DependencyObject associatedObject)
 {
   AssociatedObject = associatedObject;
   _shape = associatedObject as Shape;
   if (_shape != null)
   {
     _originalFillBrush = _shape.Fill;
     Messenger.Default.Register<DataReceivedMessage>(this, OnDateReceivedMessage);
   }
 }
开发者ID:Robotonics,项目名称:TemperatureReaderDemo,代码行数:10,代码来源:BlinkBehavior.cs


示例19: LoadCover

 public async void LoadCover()
 {
     var cover = await library.GetAlbumCoverForSong(this.Name, this.Artist);
     if (cover != null)
     {
         var bitmapImage = new BitmapImage(new Uri(cover));
         loadedCover = new ImageBrush() { ImageSource = bitmapImage, Stretch = Stretch.UniformToFill };
         NotifyPropertyChanged("AlbumCover");
     }
 }
开发者ID:JulianMH,项目名称:music-3,代码行数:10,代码来源:Album.cs


示例20: MarkdownTable

 public MarkdownTable(int columnCount, int rowCount, double borderThickness, Brush borderBrush)
 {
     this.columnCount = columnCount;
     this.rowCount = rowCount;
     this.borderThickness = borderThickness;
     for (int col = 0; col < columnCount + 1; col++)
         Children.Add(new Rectangle { Fill = borderBrush });
     for (int row = 0; row < rowCount + 1; row++)
         Children.Add(new Rectangle { Fill = borderBrush });
 }
开发者ID:QuinnDamerell,项目名称:UniversalMarkdown,代码行数:10,代码来源:MarkdownTable.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Media.ImageBrush类代码示例发布时间:2022-05-26
下一篇:
C# Input.TappedRoutedEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap