12 changed files with 241 additions and 76 deletions
@ -0,0 +1,87 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" |
|||
xmlns:chrome="clr-namespace:Microsoft.Windows.Controls.Chromes" |
|||
xmlns:primitives="clr-namespace:Microsoft.Windows.Controls.Primitives" > |
|||
|
|||
<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/> |
|||
|
|||
<Geometry x:Key="DownArrowGeometry">M 0,1 C0,1 0,0 0,0 0,0 3,0 3,0 3,0 3,1 3,1 3,1 4,1 4,1 4,1 4,0 4,0 4,0 7,0 7,0 7,0 7,1 7,1 7,1 6,1 6,1 6,1 6,2 6,2 6,2 5,2 5,2 5,2 5,3 5,3 5,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 3,3 2,3 2,3 2,3 2,2 2,2 2,2 1,2 1,2 1,2 1,1 1,1 1,1 0,1 0,1 z</Geometry> |
|||
|
|||
<Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}"> |
|||
<Setter Property="OverridesDefaultStyle" Value="true"/> |
|||
<Setter Property="IsTabStop" Value="false"/> |
|||
<Setter Property="Focusable" Value="false"/> |
|||
<Setter Property="ClickMode" Value="Press"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type ToggleButton}"> |
|||
<chrome:ButtonChrome x:Name="Chrome" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
Background="{TemplateBinding Background}" |
|||
CornerRadius="0" |
|||
RenderEnabled="{TemplateBinding IsEnabled}" |
|||
RenderMouseOver="{Binding IsMouseOver, ElementName=PART_DropDownButton}" |
|||
RenderNormal="False" |
|||
RenderPressed="{Binding IsPressed, ElementName=PART_DropDownButton}" |
|||
SnapsToDevicePixels="true" > |
|||
<Grid HorizontalAlignment="Right" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"> |
|||
<Path x:Name="Arrow" Data="{StaticResource DownArrowGeometry}" Fill="Black" HorizontalAlignment="Center" Margin="3,0,3,0" VerticalAlignment="Center"/> |
|||
</Grid> |
|||
</chrome:ButtonChrome> |
|||
<ControlTemplate.Triggers> |
|||
<Trigger Property="IsChecked" Value="true"> |
|||
<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/> |
|||
</Trigger> |
|||
<Trigger Property="IsEnabled" Value="false"> |
|||
<Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF"/> |
|||
</Trigger> |
|||
</ControlTemplate.Triggers> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="{x:Type local:CheckComboBox}"> |
|||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/> |
|||
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/> |
|||
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/> |
|||
<Setter Property="BorderThickness" Value="1"/> |
|||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> |
|||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> |
|||
<Setter Property="Padding" Value="2"/> |
|||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/> |
|||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:CheckComboBox}"> |
|||
<Grid x:Name="MainGrid" SnapsToDevicePixels="true"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*"/> |
|||
<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/> |
|||
</Grid.ColumnDefinitions> |
|||
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom"> |
|||
<Grid MinWidth="{Binding ActualWidth, ElementName=MainGrid}"> |
|||
<Border x:Name="DropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"> |
|||
<ScrollViewer x:Name="DropDownScrollViewer"> |
|||
<Grid> |
|||
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> |
|||
<Rectangle x:Name="OpaqueRect" Fill="{Binding Background, ElementName=DropDownBorder}" Height="{Binding ActualHeight, ElementName=DropDownBorder}" Width="{Binding ActualWidth, ElementName=DropDownBorder}"/> |
|||
</Canvas> |
|||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> |
|||
</Grid> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</Grid> |
|||
</Popup> |
|||
|
|||
<Border Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"/> |
|||
<TextBox Text="{TemplateBinding Text}" IsReadOnly="True" BorderThickness="0" Background="Transparent" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/> |
|||
<ToggleButton x:Name="PART_DropDownButton" Grid.Column="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
|
After Width: | Height: | Size: 312 B |
@ -0,0 +1,59 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Microsoft.Windows.Controls" > |
|||
|
|||
<Style TargetType="{x:Type local:TokenItem}"> |
|||
<Setter Property="Background" Value="#F3F7FD" /> |
|||
<Setter Property="BorderBrush" Value="#BBD8FB" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="Cursor" Value="Arrow" /> |
|||
<Setter Property="Padding" Value="5,1,5,1" /> |
|||
<Setter Property="Margin" Value="1,0" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:TokenItem}"> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Padding="{TemplateBinding Padding}" |
|||
Margin="{TemplateBinding Margin}"> |
|||
<StackPanel Orientation="Horizontal" Margin="1"> |
|||
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
<Button Margin="3,0,0,0" Cursor="Hand" Command="local:TokenizedTextBoxCommands.Delete" CommandParameter="{TemplateBinding TokenKey}" > |
|||
<Button.Template> |
|||
<ControlTemplate TargetType="Button"> |
|||
<ContentPresenter /> |
|||
</ControlTemplate> |
|||
</Button.Template> |
|||
<Image Source="/WPFToolkit.Extended;component/TokenizedTextBox/Images/delete8.png" Width="8" Height="8" /> |
|||
</Button> |
|||
</StackPanel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style TargetType="{x:Type local:TokenizedTextBox}" > |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="{x:Type local:TokenizedTextBox}"> |
|||
<Border x:Name="Bd" Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}"> |
|||
<Grid> |
|||
<RichTextBox x:Name="PART_ContentHost" AcceptsReturn="False" IsDocumentEnabled="True" Padding="-3,0,0,0" /> |
|||
<!--<Popup> |
|||
<Grid Background="White"> |
|||
<ItemsPresenter /> |
|||
</Grid> |
|||
</Popup>--> |
|||
</Grid> |
|||
</Border> |
|||
|
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
Loading…
Reference in new issue