调整代码
This commit is contained in:
182
ShrlAlgoToolkit.RevitAddins/OptionsBarResources.xaml
Normal file
182
ShrlAlgoToolkit.RevitAddins/OptionsBarResources.xaml
Normal file
@@ -0,0 +1,182 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<SolidColorBrush x:Key="PanelBackgroundBrush" Color="#FFE5F0D7" />
|
||||
<SolidColorBrush x:Key="ItemBorderBrush" Color="#666666" />
|
||||
<SolidColorBrush x:Key="ParamSeparateBrush" Color="#a0a0a0" />
|
||||
<SolidColorBrush x:Key="HeaderSeparateBrush" Color="Black" />
|
||||
<SolidColorBrush x:Key="ErrorBrush" Color="#E81123" />
|
||||
|
||||
<ControlTemplate x:Key="ValidationErrorTemplate">
|
||||
<DockPanel LastChildFill="True">
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Bottom"
|
||||
Foreground="{StaticResource ErrorBrush}"
|
||||
Text="{Binding [0].ErrorContent}" />
|
||||
<AdornedElementPlaceholder />
|
||||
</DockPanel>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="Margin" Value="5,0,0,0" />
|
||||
<Setter Property="Orientation" Value="Horizontal" />
|
||||
</Style>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style TargetType="RadioButton">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style TargetType="CheckBox">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="Margin" Value="0,1" />
|
||||
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Width" Value="100" />
|
||||
</Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Margin" Value="5,1" />
|
||||
<Setter Property="Padding" Value="2" />
|
||||
</Style>
|
||||
<Style x:Key="HeaderSeparate" TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource HeaderSeparateBrush}" />
|
||||
<Setter Property="Height" Value="14" />
|
||||
<Setter Property="Margin" Value="5,0" />
|
||||
<Setter Property="Width" Value="1" />
|
||||
</Style>
|
||||
<Style x:Key="ParameterSeparate" TargetType="Border">
|
||||
<Setter Property="Background" Value="{StaticResource ParamSeparateBrush}" />
|
||||
<!--<Setter Property="BorderBrush" Value="#ffffff" />
|
||||
<Setter Property="BorderThickness" Value="0.5,0" />-->
|
||||
<Setter Property="Height" Value="20" />
|
||||
<Setter Property="Margin" Value="10,0" />
|
||||
<Setter Property="Width" Value="2" />
|
||||
</Style>
|
||||
<Style TargetType="ComboBox">
|
||||
<Setter Property="IsSynchronizedWithCurrentItem" Value="True" />
|
||||
<Setter Property="Margin" Value="0,1" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Width" Value="100" />
|
||||
</Style>
|
||||
<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="20" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
|
||||
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="0" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrush}}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="ComboBoxInnerTextBoxTemplate" TargetType="{x:Type TextBox}">
|
||||
<Border
|
||||
x:Name="PART_ContentHost"
|
||||
Background="Transparent"
|
||||
Focusable="False" />
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="MyCustomComboBoxStyle" TargetType="{x:Type ComboBox}">
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ComboBox}">
|
||||
<Grid>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton"
|
||||
Grid.ColumnSpan="2"
|
||||
ClickMode="Press"
|
||||
Focusable="False"
|
||||
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Template="{StaticResource ComboBoxToggleButton}" />
|
||||
|
||||
<ContentPresenter
|
||||
x:Name="ContentSite"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
IsHitTestVisible="False" />
|
||||
|
||||
<TextBox
|
||||
x:Name="PART_EditableTextBox"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Focusable="True"
|
||||
IsReadOnly="{TemplateBinding IsReadOnly}"
|
||||
Style="{x:Null}"
|
||||
Template="{StaticResource ComboBoxInnerTextBoxTemplate}"
|
||||
Visibility="Hidden" />
|
||||
|
||||
<Popup
|
||||
x:Name="PART_Popup"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="1"
|
||||
AllowsTransparency="True"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
Placement="Bottom"
|
||||
PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
|
||||
<Border
|
||||
x:Name="DropDownBorder"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
Background="LightBlue"
|
||||
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
|
||||
BorderThickness="1">
|
||||
<ScrollViewer Margin="0,0,0,0" SnapsToDevicePixels="True">
|
||||
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Popup>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="MouseOver" />
|
||||
<VisualState x:Name="Disabled" />
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused" />
|
||||
<VisualState x:Name="Unfocused" />
|
||||
<VisualState x:Name="FocusedDropDown" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEditable" Value="True">
|
||||
<Setter Property="IsTabStop" Value="False" />
|
||||
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
|
||||
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user