-
-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1008 from lepoco/development
Sync development and bump version
- Loading branch information
Showing
24 changed files
with
550 additions
and
230 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
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/*' ] |
This file was deleted.
Oops, something went wrong.
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
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,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"> | ||
/// <ui:ListView ItemsSource="{Binding ...}" > | ||
/// <ui:ListView.View> | ||
/// <GridView> | ||
/// <GridViewColumn | ||
/// DisplayMemberBinding="{Binding FirstName}" | ||
/// Header="First Name" /> | ||
/// <GridViewColumn | ||
/// DisplayMemberBinding="{Binding LastName}" | ||
/// Header="Last Name" /> | ||
/// </GridView> | ||
/// </ui:ListView.View> | ||
/// </ui:ListView> | ||
/// </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))); | ||
} | ||
} |
Oops, something went wrong.