mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
Notes: -Uses a copy of VirtualizingStackPanel (to include fixes done after preview6) + fix another issue in lists -Fixes memory leaks when closing windows (by setting DataContext to null, etc.)
117 lines
No EOL
4.8 KiB
XML
117 lines
No EOL
4.8 KiB
XML
<Styles
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard"
|
|
>
|
|
<Design.PreviewWith>
|
|
<StackPanel Width="200" Height="200">
|
|
<ComboBox>
|
|
<ComboBoxItem>Test</ComboBoxItem>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
</Design.PreviewWith>
|
|
|
|
<Style Selector="ComboBox">
|
|
<Setter Property="Template">
|
|
<ControlTemplate>
|
|
<DataValidationErrors>
|
|
<Grid RowDefinitions="Auto, *, Auto" ColumnDefinitions="*,32">
|
|
<ContentPresenter x:Name="HeaderContentPresenter"
|
|
Grid.Row="0"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
IsVisible="False"
|
|
FontWeight="{DynamicResource ComboBoxHeaderThemeFontWeight}"
|
|
Margin="{DynamicResource ComboBoxTopHeaderMargin}"
|
|
VerticalAlignment="Top" />
|
|
<Border x:Name="Background"
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
MinWidth="{DynamicResource ComboBoxThemeMinWidth}" />
|
|
<Border x:Name="HighlightBackground"
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
Background="{DynamicResource ComboBoxBackgroundUnfocused}"
|
|
BorderBrush="{DynamicResource ComboBoxBackgroundBorderBrushUnfocused}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
IsVisible="False"/>
|
|
<TextBlock x:Name="PlaceholderTextBlock"
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
Margin="{TemplateBinding Padding}"
|
|
Text="{TemplateBinding PlaceholderText}"
|
|
Foreground="{TemplateBinding PlaceholderForeground}"
|
|
IsVisible="{TemplateBinding SelectionBoxItem, Converter={x:Static ObjectConverters.IsNull}}" />
|
|
<ContentControl x:Name="ContentPresenter"
|
|
Content="{TemplateBinding SelectionBoxItem}"
|
|
ContentTemplate="{TemplateBinding ItemTemplate}"
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
Margin="{TemplateBinding Padding}"
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
|
|
<Border x:Name="DropDownOverlay"
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
Background="Transparent"
|
|
Margin="0,1,1,1"
|
|
Width="30"
|
|
IsVisible="False"
|
|
HorizontalAlignment="Right" />
|
|
|
|
<PathIcon x:Name="DropDownGlyph"
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
UseLayoutRounding="False"
|
|
IsHitTestVisible="False"
|
|
Height="12"
|
|
Width="12"
|
|
Margin="0,0,10,0"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Center"
|
|
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}"
|
|
Data="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z"/>
|
|
|
|
<Popup Name="PART_Popup"
|
|
WindowManagerAddShadowHint="False"
|
|
IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}"
|
|
HorizontalOffset="-1"
|
|
VerticalOffset="-1"
|
|
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
|
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
|
PlacementTarget="Background"
|
|
Placement="BottomEdgeAlignedLeft"
|
|
IsLightDismissEnabled="True"
|
|
InheritsTransform="True">
|
|
<Border x:Name="PopupBorder"
|
|
Background="{DynamicResource ComboBoxDropDownBackground}"
|
|
BorderBrush="{DynamicResource ComboBoxDropDownBorderBrush}"
|
|
BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}"
|
|
Margin="0"
|
|
Padding="{DynamicResource ComboBoxDropdownBorderPadding}"
|
|
HorizontalAlignment="Stretch"
|
|
CornerRadius="{DynamicResource OverlayCornerRadius}">
|
|
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
|
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
|
<ItemsPresenter Name="PART_ItemsPresenter"
|
|
Margin="{DynamicResource ComboBoxDropdownContentMargin}"
|
|
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
|
</ScrollViewer>
|
|
</Border>
|
|
</Popup>
|
|
</Grid>
|
|
</DataValidationErrors>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
</Style>
|
|
</Styles> |