Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| <Canvas | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| x:Class="MyNamespace.MyCanvasCode"> | |
| <Canvas.Resources> | |
| <LinearGradientBrush x:Key="RainbowBrush"> | |
| <GradientStop Offset="0" Color="Red" /> | |
| <GradientStop Offset="0.14" Color="Orange" /> | |
| <GradientStop Offset="0.28" Color="Yellow" /> | |
| <GradientStop Offset="0.57" Color="Green" /> | |
| <GradientStop Offset="0.71" Color="Blue" /> | |
| <GradientStop Offset="0.85" Color="Indigo" /> | |
| <GradientStop Offset="1" Color="Violet" /> | |
| </LinearGradientBrush> | |
| <XmlDataProvider x:Key="XmlTeamsSource" XPath="Teams"> | |
| <x:XData> | |
| <Teams xmlns=""> | |
| <Team TeamName="Sharks" Sport="Soccer"/> | |
| </Teams> | |
| </x:XData> | |
| </XmlDataProvider> | |
| <!--<SnippetSimpleStyleDef>--> | |
| <Style x:Key="GreenButtonStyle"> | |
| <Setter Property="Control.Background" Value="Green"/> | |
| </Style> | |
| <!--</SnippetSimpleStyleDef>--> | |
| </Canvas.Resources> | |
| <!--<SnippetDPBasicCanvas>--> | |
| <Canvas Background="Green"/> | |
| <!--</SnippetDPBasicCanvas>--> | |
| <Canvas Name="myCanvas" Width="100" Height="100"> | |
| <Button Click="SetBGByResource">Set Background by Resource</Button> | |
| <Button Canvas.Top="25" Click="OnTheFlyResource">Build and Use on-the-fly Resource</Button> | |
| </Canvas> | |
| <!--<SnippetInheritanceContext>--> | |
| <StackPanel Canvas.Top="50" DataContext="{Binding Source={StaticResource XmlTeamsSource}}"> | |
| <!--<SnippetBasicInlineBinding>--> | |
| <Button Content="{Binding XPath=Team/@TeamName}"/> | |
| <!--</SnippetBasicInlineBinding>--> | |
| </StackPanel> | |
| <!--</SnippetInheritanceContext>--> | |
| <StackPanel Canvas.Top="75"> | |
| <!--<SnippetSimpleStyle>--> | |
| <Button Style="{StaticResource GreenButtonStyle}">I am green!</Button> | |
| <!--</SnippetSimpleStyle>--> | |
| </StackPanel> | |
| <!--<SnippetMiniPrecedence>--> | |
| <StackPanel> | |
| <StackPanel.Resources> | |
| <Style x:Key="{x:Type Button}" TargetType="{x:Type Button}"> | |
| <Setter Property="Background" Value="Red"/> | |
| </Style> | |
| </StackPanel.Resources> | |
| <Button Background="Green">I am NOT red!</Button> | |
| <Button>I am styled red</Button> | |
| </StackPanel> | |
| <!--</SnippetMiniPrecedence>--> | |
| <StackPanel Canvas.Top="100"> | |
| <!--<SnippetMiniAnimate>--> | |
| <Button>I am animated | |
| <Button.Background> | |
| <SolidColorBrush x:Name="AnimBrush"/> | |
| </Button.Background> | |
| <Button.Triggers> | |
| <EventTrigger RoutedEvent="Button.Loaded"> | |
| <BeginStoryboard> | |
| <Storyboard> | |
| <ColorAnimation | |
| Storyboard.TargetName="AnimBrush" | |
| Storyboard.TargetProperty="(SolidColorBrush.Color)" | |
| From="Red" To="Green" Duration="0:0:5" | |
| AutoReverse="True" RepeatBehavior="Forever" /> | |
| </Storyboard> | |
| </BeginStoryboard> | |
| </EventTrigger> | |
| </Button.Triggers> | |
| </Button> | |
| <!--</SnippetMiniAnimate>--> | |
| </StackPanel> | |
| </Canvas> |