Brush resource : Brush « Windows Presentation Foundation « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Windows Presentation Foundation » Brush 
24.81.6.Brush resource
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Grid.Resources>
    <LinearGradientBrush x:Key="backgroundBrush" StartPoint="0,0" EndPoint="1,1">
      <GradientStop Color="Blue" Offset="0"/>
      <GradientStop Color="White" Offset="0.5"/>
      <GradientStop Color="Red" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="borderBrush">Red</SolidColorBrush>
  </Grid.Resources>
  <Grid.Background>
    <StaticResource ResourceKey="backgroundBrush"/>
  </Grid.Background>
  <DockPanel>
    <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center">
      <Button Background="{StaticResource backgroundBrush}" BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="c:\image.gif"/>
      </Button>
    </StackPanel>
    <ListBox/>
  </DockPanel>
</Grid>
WPF Brush Resource
24.81.Brush
24.81.1.Set color for SolidColorBrushSet color for SolidColorBrush
24.81.2.Paint with system brushes and colors.Paint with system brushes and colors.
24.81.3.Uses a predefined SolidColorBrush, defined by the System.Windows.Media.Brushes classUses a predefined SolidColorBrush, defined by the System.Windows.Media.Brushes class
24.81.4.Gradient brushes within a DrawingBrush. Two overlapping gradients are layeredGradient brushes within a DrawingBrush. Two overlapping gradients are layered
24.81.5.OpacityMask, LinearGradientBrush, RenderTransformOpacityMask, LinearGradientBrush, RenderTransform
24.81.6.Brush resourceBrush resource
24.81.7.Use a VisualBrush to magnify a portion of the screen.Use a VisualBrush to magnify a portion of the screen.
24.81.8.Predefined brush in Brushes ClassPredefined brush in Brushes Class
24.81.9.Solid Color Brush In Code with predefined brushSolid Color Brush In Code with predefined brush
24.81.10.Solid Color Brush In Code with SolidColorBrushSolid Color Brush In Code with SolidColorBrush
24.81.11.Solid Color Brush In Code with SolidColorBrush and RGB colorSolid Color Brush In Code with SolidColorBrush and RGB color
24.81.12.Get all public static properties from Brush
24.81.13.Change the Window background with a Brush
24.81.14.Using Brushes.AliceBlue
24.81.15.Color map Brush
24.81.16.Create Vector from width and height
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.