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


C# Media.Brush类代码示例

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


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


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