-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Home page
PackagesDataGrid
bugs
- `DataGridRow`s are now highlighted on mouse click and select by adding a custom style that fixes (lepoco/wpfui#410) - `PackagesDataGrid` now does not overflow the home page and instead properly displays a scroll bar. - Also fixed a misc nullability warning in MainWindow.xaml.cs
- Loading branch information
1 parent
bf3a5a4
commit 47ea833
Showing
5 changed files
with
163 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
<!-- Style and template for the DataGridRow. --> | ||
<Style x:Key="DefaultDataGridRowStyle" TargetType="{x:Type DataGridRow}"> | ||
<Setter Property="Background"> | ||
<Setter.Value> | ||
<SolidColorBrush Opacity="0.0" Color="{DynamicResource ControlFillColorDefault}" /> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="BorderBrush" Value="Transparent" /> | ||
<Setter Property="IsTabStop" Value="False" /> | ||
<Setter Property="SnapsToDevicePixels" Value="True" /> | ||
<Setter Property="OverridesDefaultStyle" Value="True" /> | ||
<Setter Property="Validation.ErrorTemplate" Value="{x:Null}" /> | ||
<Setter Property="ValidationErrorTemplate"> | ||
<Setter.Value> | ||
<ControlTemplate> | ||
<TextBlock | ||
Margin="2,0,0,0" | ||
VerticalAlignment="Center" | ||
Foreground="{DynamicResource SystemFillColorCriticalBrush}" | ||
Text="!" /> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type DataGridRow}"> | ||
<Border | ||
x:Name="DGR_Border" | ||
Background="{TemplateBinding Background}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
SnapsToDevicePixels="True"> | ||
<SelectiveScrollingGrid> | ||
<SelectiveScrollingGrid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</SelectiveScrollingGrid.ColumnDefinitions> | ||
<SelectiveScrollingGrid.RowDefinitions> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="Auto" /> | ||
</SelectiveScrollingGrid.RowDefinitions> | ||
<DataGridCellsPresenter | ||
Grid.Column="1" | ||
ItemsPanel="{TemplateBinding ItemsPanel}" | ||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> | ||
<DataGridDetailsPresenter | ||
Grid.Row="1" | ||
Grid.Column="1" | ||
SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding AreRowDetailsFrozen, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" | ||
Visibility="{TemplateBinding DetailsVisibility}" /> | ||
<DataGridRowHeader | ||
Grid.Row="0" | ||
Grid.RowSpan="2" | ||
Grid.Column="0" | ||
SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" | ||
Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" /> | ||
</SelectiveScrollingGrid> | ||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="Normal" /> | ||
|
||
<!-- Provide a different appearance for every other row. --> | ||
<VisualState x:Name="Normal_AlternatingRow" /> | ||
|
||
<VisualState x:Name="Normal_Selected"> | ||
<Storyboard> | ||
<ColorAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Duration="0" To="{DynamicResource SystemAccentColor}" /> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.6" /> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="Unfocused_Selected"> | ||
<Storyboard> | ||
<ColorAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Duration="0" To="{DynamicResource SystemAccentColor}" /> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.6" /> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="Normal_Editing"> | ||
<Storyboard> | ||
<ColorAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Duration="0" To="{DynamicResource SystemAccentColor}" /> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.6" /> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="MouseOver_Editing"> | ||
<Storyboard> | ||
<ColorAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Duration="0" To="{DynamicResource SystemAccentColor}" /> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.8" /> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="MouseOver_Unfocused_Editing"> | ||
<Storyboard> | ||
<ColorAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Duration="0" To="{DynamicResource SystemAccentColor}" /> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.8" /> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="Unfocused_Editing"> | ||
<Storyboard> | ||
<ColorAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Duration="0" To="{DynamicResource SystemAccentColor}" /> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.6" /> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="MouseOver"> | ||
<Storyboard> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.8" /> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="MouseOver_Selected"> | ||
<Storyboard> | ||
<ColorAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Duration="0" To="{DynamicResource SystemAccentColor}" /> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.8" /> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="MouseOver_Unfocused_Selected"> | ||
<Storyboard> | ||
<ColorAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Duration="0" To="{DynamicResource SystemAccentColor}" /> | ||
<DoubleAnimation Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Opacity)" Duration="0" To="0.8" /> | ||
</Storyboard> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
</Border> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
</ResourceDictionary> |