Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync development and bump version #1008

Merged
merged 31 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f055c4c
Fix ListView to be compatible when ListView.View is a GridView
koal44 Feb 27, 2024
a4c8e9c
Bump github/codeql-action from 1 to 3
dependabot[bot] Mar 13, 2024
32a8878
Bump actions/checkout from 2 to 4
dependabot[bot] Mar 13, 2024
12fc801
Merge remote-tracking branch 'upstream/development' into fix/gridview…
koal44 Mar 14, 2024
0271f7a
Change ViewState's type from a string to an enum of two states: Defau…
koal44 Mar 14, 2024
96d10c0
Implement the GridView feature by binding directly to the View property.
koal44 Mar 14, 2024
9435ce1
Extract DefaultTextBoxScrollViewerStyle to it's own ResourceDictionary
tmijail Mar 15, 2024
93dc778
Avoid overflow in text input components
tmijail Mar 15, 2024
d5ee505
Simplify PassiveScrollViewer usage by adding properties to style
tmijail Mar 15, 2024
d1fa429
Fix TitleBarButton Foreground error when change theme
seasonyuu Mar 18, 2024
c7dc782
Merge pull request #1005 from seasonyuu/development
pomianowski Mar 18, 2024
fcb1176
Merge branch 'development' into TextInputOverflow
pomianowski Mar 18, 2024
7e25475
Merge pull request #998 from lepoco/dependabot/github_actions/develop…
pomianowski Mar 18, 2024
96b4560
Merge branch 'development' into dependabot/github_actions/development…
pomianowski Mar 18, 2024
7731860
Merge pull request #997 from lepoco/dependabot/github_actions/develop…
pomianowski Mar 18, 2024
be95ca2
Merge branch 'development' into TextInputOverflow
pomianowski Mar 18, 2024
612a785
Improve lineargradient border for TextBox in Light/Dark theme (also e…
koal44 Mar 18, 2024
7cbdc7a
Merge branch 'development' into fix/gridview-compatibility
pomianowski Mar 19, 2024
4b34485
Merge pull request #1006 from koal44/enhancement/textbox-border
pomianowski Mar 19, 2024
bd0777a
Merge pull request #999 from tmijail/TextInputOverflow
pomianowski Mar 19, 2024
c621d71
Merge branch 'development' into fix/gridview-compatibility
koal44 Mar 19, 2024
91576f1
Merge branch 'fix/gridview-compatibility' of https://github.com/koal4…
koal44 Mar 19, 2024
9c2391a
Re-implement custom ui:ListView class and remove the ListViewViewStat…
koal44 Mar 19, 2024
16c9d10
Addd documentation and tool to the VS tools manifest
koal44 Mar 19, 2024
804bf79
Merge pull request #979 from koal44/fix/gridview-compatibility
pomianowski Mar 19, 2024
585ec2d
Update release
pomianowski Mar 19, 2024
ab96a3d
Bump version
pomianowski Mar 19, 2024
7efb14a
Merge branch 'main' into development
pomianowski Mar 19, 2024
4b50f5c
Update labeler.yml
pomianowski Mar 19, 2024
c51dadb
Merge branch 'development' of https://github.com/lepoco/wpfui into de…
pomianowski Mar 19, 2024
95e8e20
Update labeler.yml
pomianowski Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 38 additions & 21 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,57 @@
release:
- base-branch: 'main'

PR:
- "*"
- base-branch: [ 'main', 'development' ]

dotnet:
- '**/*.cs'

github_actions:
- ".github/workflows/*"
- changed-files:
- any-glob-to-any-file: '.github/workflows/**'

documentation:
- "docs/*"
- changed-files:
- any-glob-to-any-file: 'docs/**'

update:
- "src/Directory.Build.props"
dotnet:
- changed-files:
- any-glob-to-any-file: '**/*.cs'

dependencies:
- "src/Packages.props"
- "branding/package.json"
- "src/Packages.props"
update:
- changed-files:
- any-glob-to-any-file: 'src/Directory.Build.props'

NuGet:
- "src/Packages.props"
- changed-files:
- any-glob-to-any-file: 'src/Directory.Packages.props'

dependencies:
- changed-files:
- any-glob-to-any-file: [ 'src/Directory.Packages.props', 'branding/package.json' ]

styles:
- "src/Wpf.Ui/**/*.xaml"
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui/**/*.xaml'

themes:
- "src/Wpf.Ui/Appearance/*"
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui/Appearance/**'

tray:
- "src/Wpf.Ui.Tray/*"
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui.Tray/**'

controls:
- "src/Wpf.Ui/Controls/*"

icons:
- "src/Wpf.Ui/Resources/Fonts/*"
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui/Controls/**'

navigation:
- "src/Wpf.Ui/Controls/NavigationView/*"
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui/Controls/NavigationView/'

gallery:
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui.Gallery/**'

icons:
- changed-files:
- any-glob-to-any-file: [ 'src/Wpf.Ui/Resources/Fonts/**', 'src/Wpf.Ui/Controls/IconSource/*', 'src/Wpf.Ui/Controls/IconElement/*' ]
39 changes: 0 additions & 39 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>3.0.1</Version>
<Version>3.0.2</Version>
<LangVersion>12.0</LangVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public partial class MainWindowViewModel : ObservableObject
{
new NavigationViewItem(nameof(System.Windows.Controls.DataGrid), typeof(DataGridPage)),
new NavigationViewItem(nameof(ListBox), typeof(ListBoxPage)),
new NavigationViewItem(nameof(ListView), typeof(ListViewPage)),
new NavigationViewItem(nameof(Ui.Controls.ListView), typeof(ListViewPage)),
new NavigationViewItem(nameof(TreeView), typeof(TreeViewPage)),
#if DEBUG
new NavigationViewItem("TreeList", typeof(TreeListPage)),
Expand Down
57 changes: 46 additions & 11 deletions src/Wpf.Ui.Gallery/Views/Pages/Collections/ListViewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Title="ListViewPage"
d:DataContext="{d:DesignInstance local:ListViewPage,
IsDesignTimeCreatable=False}"
d:DesignHeight="450"
d:DesignHeight="750"
d:DesignWidth="800"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Expand All @@ -30,17 +30,18 @@
\t&lt;/ListView.ItemTemplate&gt;\n
&lt;/ListView&gt;
</controls:ControlExample.XamlCode>
<ListView
Height="200"
<ui:ListView
MaxHeight="200"
d:ItemsSource="{d:SampleData ItemCount=2}"
ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}"
SelectedIndex="2"
SelectionMode="Single">
<ListView.ItemTemplate>
<ui:ListView.ItemTemplate>
<DataTemplate DataType="{x:Type models:Person}">
<TextBlock Margin="8,4" Text="{Binding Name, Mode=OneWay}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ui:ListView.ItemTemplate>
</ui:ListView>
</controls:ControlExample>

<controls:ControlExample Margin="0,36,0,0" HeaderText="ListView with Selection Support.">
Expand All @@ -58,13 +59,14 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ListView
<ui:ListView
Grid.Column="0"
Height="200"
MaxHeight="200"
d:ItemsSource="{d:SampleData ItemCount=2}"
ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}"
SelectedIndex="1"
SelectionMode="{Binding ViewModel.ListViewSelectionMode, Mode=OneWay}">
<ListView.ItemTemplate>
<ui:ListView.ItemTemplate>
<DataTemplate DataType="{x:Type models:Person}">
<Grid Margin="8,0">
<Grid.RowDefinitions>
Expand Down Expand Up @@ -98,8 +100,8 @@
Text="{Binding Company, Mode=OneWay}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ui:ListView.ItemTemplate>
</ui:ListView>
<StackPanel
Grid.Column="1"
MinWidth="120"
Expand All @@ -114,5 +116,38 @@
</StackPanel>
</Grid>
</controls:ControlExample>

<controls:ControlExample Margin="0,36,0,0" HeaderText="ListView with GridView">
<controls:ControlExample.XamlCode>
&lt;ListView ItemsSource=&quot;{Binding ViewModel.BasicListViewItems}&quot;&gt;\n
\t&lt;ListView.View&gt;\n
\t\t&lt;GridView&gt;\n
\t\t\t&lt;GridViewColumn DisplayMemberBinding=&quot;{Binding FirstName}&quot; Header=&quot;First Name&quot;/&gt;\n
\t\t\t&lt;GridViewColumn DisplayMemberBinding=&quot;{Binding LastName}&quot; Header=&quot;Last Name&quot;/&gt;\n
\t\t\t&lt;GridViewColumn DisplayMemberBinding=&quot;{Binding Company}&quot; Header=&quot;Company&quot;/&gt;\n
\t\t&lt;/GridView&gt;\n
\t&lt;/ListView.View&gt;\n
&lt;/ListView&gt;
</controls:ControlExample.XamlCode>
<ui:ListView
MaxHeight="200"
d:ItemsSource="{d:SampleData ItemCount=3}"
BorderThickness="0"
ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}">
<ui:ListView.View>
<GridView>
<GridViewColumn
Width="100"
DisplayMemberBinding="{Binding FirstName}"
Header="First Name" />
<GridViewColumn
Width="100"
DisplayMemberBinding="{Binding LastName}"
Header="Last Name" />
<GridViewColumn DisplayMemberBinding="{Binding Company}" Header="Company" />
</GridView>
</ui:ListView.View>
</ui:ListView>
</controls:ControlExample>
</StackPanel>
</Page>
7 changes: 5 additions & 2 deletions src/Wpf.Ui.Gallery/Views/Pages/Text/TextBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
controls:PageControlDocumentation.DocumentationType="{x:Type ui:TextBox}"
d:DataContext="{d:DesignInstance local:TextBoxPage,
IsDesignTimeCreatable=False}"
d:DesignHeight="450"
d:DesignHeight="750"
d:DesignWidth="800"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Expand All @@ -34,7 +34,10 @@
Margin="0,36,0,0"
HeaderText="A multi-line TextBox."
XamlCode="&lt;ui:TextBox PlaceholderText=&quot;Type something...&quot;TextWrapping=&quot;Wrap&quot; /&gt;">
<ui:TextBox PlaceholderText="Type something..." TextWrapping="Wrap" />
<ui:TextBox
MinHeight="100"
PlaceholderText="Type something..."
TextWrapping="Wrap" />
</controls:ControlExample>
</StackPanel>
</Page>
1 change: 0 additions & 1 deletion src/Wpf.Ui.Tray/Wpf.Ui.Tray.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<PropertyGroup>
<GeneratePackageOnBuild Condition="'$(Configuration)'=='Release'">true</GeneratePackageOnBuild>
<GenerateDocumentationFile Condition="'$(Configuration)'=='Release'">true</GenerateDocumentationFile>
<DebugType Condition="'$(Configuration)'=='Release'">none</DebugType>
<PackageIcon>wpfui.png</PackageIcon>
</PropertyGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/Wpf.Ui/Controls/AutoSuggestBox/AutoSuggestBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
BorderThickness="1"
CornerRadius="8"
SnapsToDevicePixels="True">
<ListView
<controls:ListView
x:Name="PART_SuggestionsList"
MaxHeight="{TemplateBinding MaxSuggestionListHeight}"
DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
Expand All @@ -154,15 +154,15 @@
ItemsSource="{TemplateBinding ItemsSource}"
KeyboardNavigation.DirectionalNavigation="Cycle"
SelectionMode="Single">
<ListView.ItemsPanel>
<controls:ListView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel
IsItemsHost="True"
IsVirtualizing="True"
VirtualizationMode="Recycling" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
</controls:ListView.ItemsPanel>
</controls:ListView>
</Border>
</Popup>
</Grid>
Expand Down
7 changes: 4 additions & 3 deletions src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Decorator
<controls:PassiveScrollViewer
x:Name="PART_ContentHost"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Margin="{TemplateBinding Padding}"
Style="{DynamicResource DefaultTextBoxScrollViewerStyle}"
TextElement.Foreground="{TemplateBinding Foreground}" />
</ControlTemplate>
</Setter.Value>
Expand Down
88 changes: 88 additions & 0 deletions src/Wpf.Ui/Controls/ListView/ListView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
namespace Wpf.Ui.Controls;

/// <summary>
/// Extends <see cref="System.Windows.Controls.ListView"/>, and adds customized support <see cref="ListViewViewState.GridView"/> or <see cref="ListViewViewState.Default"/>.
/// </summary>
/// <example>
/// <code lang="xml">
/// &lt;ui:ListView ItemsSource="{Binding ...}" &gt;
/// &lt;ui:ListView.View&gt;
/// &lt;GridView&gt;
/// &lt;GridViewColumn
/// DisplayMemberBinding="{Binding FirstName}"
/// Header="First Name" /&gt;
/// &lt;GridViewColumn
/// DisplayMemberBinding="{Binding LastName}"
/// Header="Last Name" /&gt;
/// &lt;/GridView&gt;
/// &lt;/ui:ListView.View&gt;
/// &lt;/ui:ListView&gt;
/// </code>
/// </example>
public class ListView : System.Windows.Controls.ListView
{
/// <summary>Identifies the <see cref="ViewState"/> dependency property.</summary>
public static readonly DependencyProperty ViewStateProperty = DependencyProperty.Register(nameof(ViewState), typeof(ListViewViewState), typeof(ListView), new FrameworkPropertyMetadata(ListViewViewState.Default, OnViewStateChanged));

/// <summary>
/// Gets or sets the view state of the <see cref="ListView"/>, enabling custom logic based on the current view.
/// </summary>
/// <value>The current view state of the <see cref="ListView"/>.</value>
public ListViewViewState ViewState
{
get => (ListViewViewState)GetValue(ViewStateProperty);
set => SetValue(ViewStateProperty, value);
}

private static void OnViewStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is not ListView self)
{
return;
}

self.OnViewStateChanged(e);
}

protected virtual void OnViewStateChanged(DependencyPropertyChangedEventArgs e)
{
// Hook for derived classes to react to ViewState property changes
}

public ListView()
{
Loaded += OnLoaded;
}

private void OnLoaded(object sender, RoutedEventArgs e)
{
Loaded -= OnLoaded; // prevent memory leaks

// Setup initial ViewState and hook into View property changes
var descriptor = DependencyPropertyDescriptor.FromProperty(System.Windows.Controls.ListView.ViewProperty, typeof(System.Windows.Controls.ListView));
descriptor?.AddValueChanged(this, OnViewPropertyChanged);
UpdateViewState(); // set the initial state
}

private void OnViewPropertyChanged(object? sender, EventArgs e)
{
UpdateViewState();
}

private void UpdateViewState()
{
ListViewViewState viewState = View switch
{
System.Windows.Controls.GridView => ListViewViewState.GridView,
null => ListViewViewState.Default,
_ => ListViewViewState.Default
};

SetCurrentValue(ViewStateProperty, viewState);
}

static ListView()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ListView), new FrameworkPropertyMetadata(typeof(ListView)));
}
}
Loading
Loading