Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"Bash(docfx docs/docfx.json)",
"mcp__microsoft_docs__microsoft_code_sample_search",
"mcp__context7__resolve-library-id",
"mcp__context7__query-docs"
"mcp__context7__query-docs",
"WebFetch(domain:devblogs.microsoft.com)",
"Bash(dotnet build *)"
]
}
}
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ insert_final_newline = false
#### Build files ####

# Solution files
[*.{sln,slnx}]
[*.{sln}]
tab_width = 4
indent_size = 4
indent_style = tab

# Configuration files
[*.{json,xml,yml,config,runsettings}]
[*.{json,xml,yml,config,runsettings,slnx}]
indent_size = 2

# MSBuild files
Expand Down
4 changes: 0 additions & 4 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ Central Package Management: Directory.Packages.props - NEVER add package version
Build library:
dotnet build src/Wpf.Ui/Wpf.Ui.csproj

Solution filters:
- Wpf.Ui.Library.slnf - Library projects only
- Wpf.Ui.Gallery.slnf - Gallery demo app

Testing:
- XUnit v3 for unit tests (tests/Wpf.Ui.UnitTests/)
- AwesomeAssertions for assertions (FluentAssertions successor)
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/wpf-ui-cd-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: wpf-ui-cd-extension

on:
push:
branches: [main]
branches: [ main ]
paths:
- 'src/Wpf.Ui.Extension**'
- "src/Wpf.Ui.Extension**"

workflow_dispatch:

Expand All @@ -26,13 +26,19 @@ jobs:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}

- name: Restore dependencies
run: nuget restore Wpf.Ui.sln
run: dotnet restore src\Wpf.Ui.Extension\Wpf.Ui.Extension.csproj

- name: Build the solution
run: msbuild src\Wpf.Ui.Extension\Wpf.Ui.Extension.csproj /t:Rebuild -p:Configuration=Release -p:RestorePackages=false -p:Platform="x64" -p:ProductArchitecture="amd64" -p:GITHUB_ACTIONS=True -p:LangVersion=8.0
run: msbuild src\Wpf.Ui.Extension\Wpf.Ui.Extension.csproj /t:Rebuild
-p:Configuration=Release -p:RestorePackages=false
-p:Platform="x64" -p:ProductArchitecture="amd64"
-p:GITHUB_ACTIONS=True -p:LangVersion=8.0

- name: Build the solution
run: msbuild src\Wpf.Ui.Extension\Wpf.Ui.Extension.csproj /t:Rebuild -p:Configuration=Release -p:RestorePackages=false -p:Platform="arm64" -p:ProductArchitecture="arm64" -p:GITHUB_ACTIONS=True -p:LangVersion=8.0
run: msbuild src\Wpf.Ui.Extension\Wpf.Ui.Extension.csproj /t:Rebuild
-p:Configuration=Release -p:RestorePackages=false -p:Platform="arm64"
-p:ProductArchitecture="arm64" -p:GITHUB_ACTIONS=True
-p:LangVersion=8.0

- uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory>
</PropertyGroup>
<PropertyGroup>
<Version>4.2.1</Version>
<AssemblyVersion>4.2.0</AssemblyVersion>
<Version>5.0.0-preview.1</Version>
<AssemblyVersion>5.0.0</AssemblyVersion>
</PropertyGroup>
<PropertyGroup>
<Company>lepo.co</Company>
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<PackageVersion Include="System.Drawing.Common" Version="10.0.7" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
<PackageVersion Include="System.ValueTuple" Version="4.6.2" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
<PackageVersion Include="WpfAnalyzers" Version="4.1.1" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
</ItemGroup>
Expand Down
13 changes: 0 additions & 13 deletions Wpf.Ui.Gallery.slnf

This file was deleted.

10 changes: 0 additions & 10 deletions Wpf.Ui.Library.slnf

This file was deleted.

408 changes: 0 additions & 408 deletions Wpf.Ui.sln

This file was deleted.

3 changes: 3 additions & 0 deletions Wpf.Ui.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
Comment thread
pomianowski marked this conversation as resolved.
<s:Boolean x:Key="/Default/UserDictionary/Words/=snackbar/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Snackbars/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
102 changes: 102 additions & 0 deletions Wpf.Ui.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<Solution>
<Configurations>
<Platform Name="Any CPU" />
<Platform Name="arm64" />
<Platform Name="x64" />
<Platform Name="x86" />
</Configurations>
<Folder Name="/Samples/">
<Project Path="samples/Wpf.Ui.Demo.Console/Wpf.Ui.Demo.Console.csproj" />
<Project Path="samples/Wpf.Ui.Demo.Dialogs/Wpf.Ui.Demo.Dialogs.csproj" />
<Project Path="samples/Wpf.Ui.Demo.Mvvm/Wpf.Ui.Demo.Mvvm.csproj" />
<Project Path="samples/Wpf.Ui.Demo.SetResources.Simple/Wpf.Ui.Demo.SetResources.Simple.csproj" />
<Project Path="samples/Wpf.Ui.Demo.Simple/Wpf.Ui.Demo.Simple.csproj" />
</Folder>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path="Directory.Build.props" />
<File Path="Directory.Build.targets" />
<File Path="Directory.Packages.props" />
<File Path="LICENSE" />
<File Path="LICENSE.md" />
<File Path="nuget.config" />
<File Path="README.md" />
<File Path="Settings.XamlStyler" />
<File Path="ThirdPartyNotices.txt" />
</Folder>
<Folder Name="/Tests/">
<Project Path="tests/Wpf.Ui.Gallery.IntegrationTests/Wpf.Ui.Gallery.IntegrationTests.csproj" />
<Project Path="tests/Wpf.Ui.UnitTests/Wpf.Ui.UnitTests.csproj" />
</Folder>
<Project Path="src/Wpf.Ui.Abstractions/Wpf.Ui.Abstractions.csproj" />
<Project Path="src/Wpf.Ui.DependencyInjection/Wpf.Ui.DependencyInjection.csproj" />
<Project
Path="src/Wpf.Ui.Extension.Template.Blank/Wpf.Ui.Extension.Template.Blank.csproj"
Id="ab3d44b5-9491-487e-a134-9ac5bed2b981"
>
<Platform Solution="*|arm64" Project="arm64" />
<Platform Solution="*|x64" Project="x64" />
<Platform Solution="*|x86" Project="x86" />
<Build Solution="*|x86" Project="false" />
<Build Solution="Debug|Any CPU" Project="false" />
<Build Solution="Debug|arm64" Project="false" />
<Build Solution="Debug|x64" Project="false" />
</Project>
<Project
Path="src/Wpf.Ui.Extension.Template.Compact/Wpf.Ui.Extension.Template.Compact.csproj"
Id="14d7431c-6cff-4191-bb88-2b8d5f323a30"
>
<Platform Solution="*|arm64" Project="arm64" />
<Platform Solution="*|x64" Project="x64" />
<Platform Solution="*|x86" Project="x86" />
<Build Solution="*|x86" Project="false" />
<Build Solution="Debug|Any CPU" Project="false" />
<Build Solution="Debug|arm64" Project="false" />
<Build Solution="Debug|x64" Project="false" />
</Project>
<Project
Path="src/Wpf.Ui.Extension.Template.Fluent/Wpf.Ui.Extension.Template.Fluent.csproj"
Id="4d2706b5-27a9-4542-bd4d-8c22d12d0628"
>
<Platform Solution="*|arm64" Project="arm64" />
<Platform Solution="*|x64" Project="x64" />
<Platform Solution="*|x86" Project="x86" />
<Build Solution="*|x86" Project="false" />
<Build Solution="Debug|Any CPU" Project="false" />
<Build Solution="Debug|arm64" Project="false" />
<Build Solution="Debug|x64" Project="false" />
</Project>
<Project Path="src/Wpf.Ui.Extension/Wpf.Ui.Extension.csproj" Id="1298d974-9d81-4a93-9374-ea6a0e723deb">
<Platform Solution="*|arm64" Project="arm64" />
<Platform Solution="*|x64" Project="x64" />
<Platform Solution="*|x86" Project="x86" />
<Build Solution="*|x86" Project="false" />
<Build Solution="Debug|Any CPU" Project="false" />
<Build Solution="Debug|arm64" Project="false" />
<Build Solution="Debug|x64" Project="false" />
</Project>
<Project Path="src/Wpf.Ui.FlaUI/Wpf.Ui.FlaUI.csproj" />
<Project Path="src/Wpf.Ui.FontMapper/Wpf.Ui.FontMapper.csproj" />
<Project
Path="src/Wpf.Ui.Gallery.Package/Wpf.Ui.Gallery.Package.wapproj"
Type="c7167f0d-bc9f-4e6e-afe1-012c56b48db5"
>
<Platform Solution="*|arm64" Project="ARM64" />
<Build Solution="*|Any CPU" Project="false" />
<Build Solution="Debug|arm64" Project="false" />
<Build Solution="Debug|x64" Project="false" />
<Build Solution="Debug|x86" Project="false" />
<Deploy Solution="Release|arm64" />
<Deploy Solution="Release|x64" />
<Deploy Solution="Release|x86" />
</Project>
<Project Path="src/Wpf.Ui.Gallery/Wpf.Ui.Gallery.csproj">
<Platform Solution="*|arm64" Project="arm64" />
<Platform Solution="*|x64" Project="x64" />
<Platform Solution="*|x86" Project="x86" />
</Project>
<Project Path="src/Wpf.Ui.SyntaxHighlight/Wpf.Ui.SyntaxHighlight.csproj" />
<Project Path="src/Wpf.Ui.ToastNotifications/Wpf.Ui.ToastNotifications.csproj" />
<Project Path="src/Wpf.Ui.Tray/Wpf.Ui.Tray.csproj" />
<Project Path="src/Wpf.Ui/Wpf.Ui.csproj" />
</Solution>
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if ($dotnetVersion -eq $null) {
}

if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") {
dotnet restore Wpf.Ui.sln /tl
dotnet restore Wpf.Ui.slnx /tl
dotnet build src\Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj --configuration Release --no-restore --verbosity quiet /tl
} else {
Write-Host "Not in the x64 desktop environment."
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ To ensure you receive the expert guidance you need, we offer a variety of suppor
<a class="btn btn-block btn-outline-light" href="https://github.com/sponsors/pomianowski">Sponsor WPF UI on GitHub</a>
</div>
</div>

![Demo App Sample](https://user-images.githubusercontent.com/13592821/166259110-0fb98120-fe34-4e6d-ab92-9f72ad7113c3.png)

![Monaco Editor](https://user-images.githubusercontent.com/13592821/258610583-7d71f69d-45b3-4be6-bcb8-8cf6cd60a2ff.png)
Expand Down
6 changes: 3 additions & 3 deletions samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ private async void OnShowDialogClick(object sender, RoutedEventArgs e)
await Application.Current.Dispatcher.InvokeAsync(ShowSampleDialogAsync);
}

private async Task ShowSampleDialogAsync()
private Task<ContentDialogResult> ShowSampleDialogAsync()
{
// Defining dialog object
ContentDialog myDialog = new()
var myDialog = new ContentDialog
{
Title = "My sample dialog",
Content = "Content of the dialog",
Expand All @@ -40,6 +40,6 @@ private async Task ShowSampleDialogAsync()
myDialog.DialogHost = ContentPresenterForDialogs;

// Showing the dialog
await myDialog.ShowAsync(CancellationToken.None);
return myDialog.ShowAsync(CancellationToken.None);
}
}
2 changes: 1 addition & 1 deletion samples/Wpf.Ui.Demo.Mvvm/ViewModels/DataViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public partial class DataViewModel : ViewModel
[ObservableProperty]
private List<DataColor> _colors = [];

public override void OnNavigatedTo()
public override void OnNavigatedTo(CancellationToken cancellationToken = default)
{
if (!_isInitialized)
{
Expand Down
2 changes: 1 addition & 1 deletion samples/Wpf.Ui.Demo.Mvvm/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public partial class SettingsViewModel : ViewModel
.ApplicationTheme
.Unknown;

public override void OnNavigatedTo()
public override void OnNavigatedTo(CancellationToken cancellationToken = default)
{
if (!_isInitialized)
{
Expand Down
16 changes: 8 additions & 8 deletions samples/Wpf.Ui.Demo.Mvvm/ViewModels/ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ namespace Wpf.Ui.Demo.Mvvm.ViewModels;
public abstract class ViewModel : ObservableObject, INavigationAware
{
/// <inheritdoc />
public virtual Task OnNavigatedToAsync()
public virtual ValueTask OnNavigatedToAsync(CancellationToken cancellationToken = default)
{
OnNavigatedTo();
OnNavigatedTo(cancellationToken);

return Task.CompletedTask;
return default;
}

/// <summary>
/// Handles the event that is fired after the component is navigated to.
/// </summary>
// ReSharper disable once MemberCanBeProtected.Global
public virtual void OnNavigatedTo() { }
public virtual void OnNavigatedTo(CancellationToken cancellationToken = default) { }

/// <inheritdoc />
public virtual Task OnNavigatedFromAsync()
public virtual ValueTask OnNavigatedFromAsync(CancellationToken cancellationToken = default)
{
OnNavigatedFrom();
OnNavigatedFrom(cancellationToken);

return Task.CompletedTask;
return default;
}

/// <summary>
/// Handles the event that is fired before the component is navigated from.
/// </summary>
// ReSharper disable once MemberCanBeProtected.Global
public virtual void OnNavigatedFrom() { }
public virtual void OnNavigatedFrom(CancellationToken cancellationToken = default) { }
}
2 changes: 2 additions & 0 deletions samples/Wpf.Ui.Demo.Mvvm/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<ui:NavigationView
x:Name="RootNavigation"
Grid.Row="1"
IsFooterSeparatorVisible="False"
IsTopSeparatorVisible="False"
FooterMenuItemsSource="{Binding ViewModel.NavigationFooter, Mode=OneWay}"
MenuItemsSource="{Binding ViewModel.NavigationItems, Mode=OneWay}"
>
Expand Down
5 changes: 4 additions & 1 deletion samples/Wpf.Ui.Demo.Simple/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:NavigationView x:Name="RootNavigation" Grid.Row="1">
<ui:NavigationView
x:Name="RootNavigation" Grid.Row="1"
IsFooterSeparatorVisible="False"
IsTopSeparatorVisible="False">
<ui:NavigationView.AutoSuggestBox>
<ui:AutoSuggestBox x:Name="AutoSuggestBox" PlaceholderText="Search">
<ui:AutoSuggestBox.Icon>
Expand Down
6 changes: 4 additions & 2 deletions src/Wpf.Ui.Abstractions/Controls/INavigationAware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using System.Threading;

namespace Wpf.Ui.Abstractions.Controls;

/// <summary>
Expand All @@ -14,11 +16,11 @@ public interface INavigationAware
/// Asynchronously handles the event that is fired after the component is navigated to.
/// </summary>
/// <returns>A task that represents the asynchronous operation.</returns>
Task OnNavigatedToAsync();
ValueTask OnNavigatedToAsync(CancellationToken cancellationToken = default);

/// <summary>
/// Asynchronously handles the event that is fired before the component is navigated from.
/// </summary>
/// <returns>A task that represents the asynchronous operation.</returns>
Task OnNavigatedFromAsync();
ValueTask OnNavigatedFromAsync(CancellationToken cancellationToken = default);
}
Loading
Loading