本文整理汇总了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);
}
示例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;
}
}
}
示例3: SetHighlightBrush
public static void SetHighlightBrush(DependencyObject sender, Brush highlightBrush) {
if (sender == null) {
return;
}
sender.SetValue(HighlightBrushProperty, highlightBrush);
}
示例4: CellColor
public CellColor(Brush fill, Brush group, Brush star)
{
FillColor = fill;
GroupColor = group;
StarColor = star;
BorderColor = star;
}
示例5: Series
public Series(Grid container, double margin, DataItemCollection dataItem,Brush palette)
{
this._container = container;
this._ItemSource = dataItem;
this.margin = margin;
this._palette = palette;
}
示例6: SetHeaderForeground
public static void SetHeaderForeground(DependencyObject obj, Brush value)
{
if (obj == null)
throw new ArgumentNullException(nameof(obj));
obj.SetValue(HeaderForegroundProperty, value);
}
示例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));
}
示例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);
}
}
示例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();
}
示例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;
}
}
示例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);
}
示例12: Overlay
public Overlay(Image imageControl, Rect rect)
{
_Parent = (Grid)imageControl.Parent;
_Rectangle = rect;
_Transparent = new SolidColorBrush(Colors.Transparent);
_Red = new SolidColorBrush(Colors.Red);
}
示例13: TextBoxCueBanner
public TextBoxCueBanner()
{
this.DefaultStyleKey = typeof(TextBox);
CueBannerState = true;
CueBannerActiveBrush = this.BorderBrush;
CueBannerInactiveBrush = this.Foreground;
}
示例14: ChartControl
public ChartControl()
{
this.DataPointCount = DefaultDatapoints;
this.chartColor = new SolidColorBrush(Windows.UI.Color.FromArgb(0xFF, 0xDD, 0xFF, 0xDD));
DrawBackground();
}
示例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;
}