You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
5.3 KiB
90 lines
5.3 KiB
<!--*********************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2010-2012 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Public
|
|
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
This program can be provided to you by Xceed Software Inc. under a
|
|
proprietary commercial license agreement for use in non-Open Source
|
|
projects. The commercial version of Extended WPF Toolkit also includes
|
|
priority technical support, commercial updates, and many additional
|
|
useful WPF controls if you license Xceed Business Suite for WPF.
|
|
|
|
Visit http://xceed.com and follow @datagrid on Twitter.
|
|
|
|
********************************************************************-->
|
|
<sample:DemoView x:Class="Samples.Modules.MessageBox.Views.HomeView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sample="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
Title="MessageBox"
|
|
Description="This extended MessageBox allows you to customize and style various aspects of the control.">
|
|
<sample:DemoView.Resources>
|
|
<SolidColorBrush x:Key="MyButtonHoverBrush" Color="YellowGreen" />
|
|
<SolidColorBrush x:Key="MyButtonPressedBrush" Color="Maroon" />
|
|
|
|
<Style x:Key="MyCloseButtonStyle" TargetType="Button">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Grid>
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
<VisualState x:Name="Normal"/>
|
|
<VisualState x:Name="MouseOver">
|
|
<Storyboard>
|
|
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background)">
|
|
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource MyButtonHoverBrush}"></DiscreteObjectKeyFrame>
|
|
</ObjectAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Pressed">
|
|
<Storyboard>
|
|
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background)">
|
|
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource MyButtonPressedBrush}"></DiscreteObjectKeyFrame>
|
|
</ObjectAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</VisualState>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
<Border x:Name="Background" CornerRadius="0,0,2,0" Background="Green">
|
|
<Border Margin="1,0,1,1" BorderBrush="#59FFFFFF" BorderThickness="1" CornerRadius="0,0,1,0"/>
|
|
</Border>
|
|
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
|
<Path x:Name="path" Fill="White" Margin="0,0,0,1" Visibility="Collapsed"
|
|
Height="6"
|
|
Width="7"
|
|
Stretch="Fill"
|
|
Opacity="1"
|
|
Data="M 2,6 C2,6 3,6 3,6 3,6 3,5 3,5 3,5 4,5 4,5 4,5 4,6 4,6 4,6 5,6 5,6 5,6 7,6 7,6 7,6 7,5 7,5 7,5 6,5 6,5 6,5 6,4 6,4 6,4 5,4 5,4 5,4 5,2 5,2 5,2 6,2 6,2 6,2 6,1 6,1 6,1 7,1 7,1 7,1 7,0 7,0 7,0 5,0 5,0 5,0 4,0 4,0 4,0 4,1 4,1 4,1 3,1 3,1 3,1 3,0 3,0 3,0 2,0 2,0 2,0 0,0 0,0 0,0 0,1 0,1 0,1 1,1 1,1 1,1 1,2 1,2 1,2 2,2 2,2 2,2 2,4 2,4 2,4 1,4 1,4 1,4 1,5 1,5 1,5 0,5 0,5 0,5 0,6 0,6 0,6 2,6 2,6 z"/>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="messageBoxStyle" TargetType="{x:Type xctk:MessageBox}">
|
|
<Setter Property="Background" Value="Aquamarine" />
|
|
<Setter Property="BorderBrush" Value="Red" />
|
|
<Setter Property="CaptionForeground" Value="Orange" />
|
|
<Setter Property="WindowBorderBrush" Value="Blue" />
|
|
<Setter Property="WindowBackground" Value="Green" />
|
|
<Setter Property="WindowOpacity" Value="0.3" />
|
|
<Setter Property="Foreground" Value="Purple"/>
|
|
<Setter Property="CloseButtonStyle" Value="{StaticResource MyCloseButtonStyle}"/>
|
|
</Style>
|
|
</sample:DemoView.Resources>
|
|
|
|
<Grid >
|
|
<Button Width="300"
|
|
Height="100"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Center"
|
|
Content="Show me that ugly styled MessageBox!"
|
|
Click="Button_Click"/>
|
|
</Grid>
|
|
</sample:DemoView>
|
|
|