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.
407 lines
24 KiB
407 lines
24 KiB
<!--*************************************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2007-2014 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
|
|
|
|
For more features, controls, and fast professional support,
|
|
pick up the Plus Edition at http://xceed.com/wpf_toolkit
|
|
|
|
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
|
|
|
|
************************************************************************************-->
|
|
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views.ThemingListBoxView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
xmlns:xclb="http://schemas.xceed.com/wpf/xaml/listbox"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
xmlns:view="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.Theming.Views"
|
|
VerticalScrollBarVisibility="Disabled"
|
|
Title="Theming ListBox"
|
|
x:Name="_demo">
|
|
<local:DemoView.Description>
|
|
<Paragraph FontSize="14" FontFamily="Segoe">
|
|
<Run>Dress Up Your App in Style in Minutes</Run>
|
|
<LineBreak />
|
|
<LineBreak />
|
|
<!--//# TODODOC -->
|
|
<Run>Supports implicit styles, so the entire listbox can be styled in minutes with a couple of lines of code. Also supports explicit styles and Expression Blend. Available themes are System, Office2007, LiveExplorer, MediaPlayer and Metro with accent color. The Xceed.Wpf.ListBox.Themes.xxx.dll assembly is necessary to use the themes.</Run>
|
|
<!--##INCLUDE_OPEN_SOURCE
|
|
<LineBreak />
|
|
<Run>This feature is only available in the "Plus" version.</Run>
|
|
<LineBreak />
|
|
<Hyperlink NavigateUri="http://www.xceed.com/Extended_WPF_Toolkit_Intro.html" RequestNavigate="Hyperlink_RequestNavigate">
|
|
Click here for more details about Xceed Extended WPF Toolkit Plus.
|
|
</Hyperlink>
|
|
##END-->
|
|
</Paragraph>
|
|
</local:DemoView.Description>
|
|
|
|
<!--##EXCLUDE_OPEN_SOURCE-->
|
|
<local:DemoView.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="../ItemTemplates/ItemTemplates.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<PropertyGroupDescription x:Key="shipCountryGroupDescription"
|
|
PropertyName="ShipCountry" />
|
|
|
|
<PropertyGroupDescription x:Key="shipCityGroupDescription"
|
|
PropertyName="ShipCity" />
|
|
|
|
<ObjectDataProvider x:Key="ComboBoxThemes" MethodName="GetValues"
|
|
ObjectType="{x:Type sys:Enum}">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="view:ThemesEnum" />
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
|
|
<Style x:Key="MetroSampleRadioButtonTemplate" TargetType="RadioButton">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="RadioButton">
|
|
<Grid>
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup x:Name="CommonStates">
|
|
<VisualStateGroup.Transitions>
|
|
<VisualTransition GeneratedDuration="0:0:0.2" />
|
|
<VisualTransition From="Normal"
|
|
GeneratedDuration="0"
|
|
To="Pressed">
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0"
|
|
To="0.45"
|
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
|
Storyboard.TargetName="rectangle" />
|
|
</Storyboard>
|
|
</VisualTransition>
|
|
</VisualStateGroup.Transitions>
|
|
<VisualState x:Name="Normal" />
|
|
<VisualState x:Name="MouseOver">
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0"
|
|
To="0.35"
|
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
|
Storyboard.TargetName="rectangle" />
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Pressed">
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0"
|
|
To="0.35"
|
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
|
Storyboard.TargetName="rectangle" />
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Disabled">
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0"
|
|
To=".2"
|
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
|
Storyboard.TargetName="content" />
|
|
</Storyboard>
|
|
</VisualState>
|
|
</VisualStateGroup>
|
|
<VisualStateGroup x:Name="CheckStates">
|
|
<VisualStateGroup.Transitions>
|
|
<VisualTransition GeneratedDuration="0:0:0.2" />
|
|
</VisualStateGroup.Transitions>
|
|
<VisualState x:Name="Checked">
|
|
<Storyboard>
|
|
<DoubleAnimation Duration="0"
|
|
To="1"
|
|
Storyboard.TargetProperty="(UIElement.Opacity)"
|
|
Storyboard.TargetName="CheckIcon" />
|
|
</Storyboard>
|
|
</VisualState>
|
|
<VisualState x:Name="Unchecked" />
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
<Rectangle x:Name="content"
|
|
Width="20"
|
|
Height="20"
|
|
Fill="{TemplateBinding Background}" />
|
|
<Path x:Name="CheckIcon"
|
|
Data="M 619,736 C619,736 617,738 617,738 617,738 621,742 621,742 621,742 629,732 629,732 629,732 627,730 627,730 627,730 621,738 621,738 621,738 619,736 619,736 z"
|
|
Fill="White"
|
|
FlowDirection="LeftToRight"
|
|
Opacity="0"
|
|
Stretch="Fill"
|
|
UseLayoutRounding="False"
|
|
VerticalAlignment="Bottom"
|
|
HorizontalAlignment="Right"
|
|
Width="12"
|
|
Height="12"
|
|
Margin="0,0,1,1" />
|
|
<Rectangle x:Name="rectangle"
|
|
Fill="White"
|
|
Opacity="0" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
</ResourceDictionary>
|
|
</local:DemoView.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<GroupBox Header="Features" Grid.Row="0" Margin="5">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Margin="0,5,5,5" Orientation="Horizontal">
|
|
<TextBlock Text="Themes:" Margin="0,5,5,5" VerticalAlignment="Center"/>
|
|
<ComboBox x:Name="themeComboBox" Width="150" Height="25"
|
|
SelectedIndex="0"
|
|
VerticalAlignment="Center"
|
|
SelectionChanged="ThemeComboBoxSelectionChanged"
|
|
ItemsSource="{Binding Source={StaticResource ComboBoxThemes}}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel x:Name="_accentColorPanel"
|
|
Grid.Column="1" Margin="10,0,0,0"
|
|
Orientation="Horizontal"
|
|
VerticalAlignment="Top"
|
|
HorizontalAlignment="Left"
|
|
Visibility="Hidden">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel>
|
|
<TextBlock Text="Accent Color"
|
|
FontFamily="Segoe UI"
|
|
FontSize="13"
|
|
Foreground="#414141" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<RadioButton Background="#FFF4B300"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Gold"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF78BA00"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="LightGreen"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF2673EC"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Blue"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFAE113D"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="MediumVioletRed"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF632F00"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Brown"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFB01E00"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="DarkRed"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFC1004F"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="PaleVioletRed"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF7200AC"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="DarkViolet"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF4617B4"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="DarkSlateBlue"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF006AC1"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="RoyalBlue"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF008287"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Teal"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF199900"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Green"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF00C13F"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Lime"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,2,0,0">
|
|
<RadioButton Background="#FFFF981D"
|
|
Margin="0,0,2,0"
|
|
IsChecked="True"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="LightSalmon"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFFF2E12"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Red"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFFF1D77"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="DeepPink"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFAA40FF"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Purple"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF1FAEFF"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="DeepSkyBlue"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF56C5FF"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="DarkTurquoise"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF00D8CC"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Turquoise"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF91D100"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="YellowGreen"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFE1B700"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="DarkYellow"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFFF76BC"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Pink"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FF00A4A4"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="LightSeaGreen"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Background="#FFFF7D23"
|
|
Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Orange"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<StackPanel Margin="10,0,0,0">
|
|
<TextBlock Text="Custom Color"
|
|
FontFamily="Segoe UI"
|
|
FontSize="13"
|
|
Foreground="#414141" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<RadioButton Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
Background="{StaticResource customAccentBrush1}"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Custom1"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
Background="{StaticResource customAccentBrush2}"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Custom2"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
<RadioButton Margin="0,0,2,0"
|
|
Checked="RadioButton_Checked"
|
|
Background="{StaticResource customAccentBrush3}"
|
|
GroupName="themeRadioGroup"
|
|
Tag="Custom3"
|
|
Style="{StaticResource MetroSampleRadioButtonTemplate}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<TextBlock Grid.Row="1" Margin="10" HorizontalAlignment="Left" Text="Usage:" Style="{StaticResource Header}"/>
|
|
|
|
<Border Grid.Row="2" x:Name="myBorder">
|
|
<xclb:ListBox x:Name="_listBox"
|
|
ItemsSource="{Binding}"
|
|
ItemTemplate="{StaticResource orderListBoxItemTemplate}"
|
|
ToolPaneVisibility="Visible">
|
|
|
|
<xclb:SearchTextBox.FilteredFieldNames>
|
|
<xclb:FieldNameList>
|
|
<sys:String>ShipCountry</sys:String>
|
|
</xclb:FieldNameList>
|
|
</xclb:SearchTextBox.FilteredFieldNames>
|
|
|
|
<xclb:DataNavigationControl.DataNavigationConfiguration>
|
|
<xclb:AlphabeticalDataNavigationConfiguration />
|
|
</xclb:DataNavigationControl.DataNavigationConfiguration>
|
|
</xclb:ListBox>
|
|
</Border>
|
|
</Grid>
|
|
<!--##END-->
|
|
|
|
<!--##INCLUDE_OPEN_SOURCE
|
|
<Image Source="..\OpenSourceImages\ListBoxControls.png" Width="700" Height="500"/>
|
|
##END-->
|
|
</local:DemoView>
|
|
|