Skip to content
Merged
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
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.0.1",
"commands": [
"csharpier"
],
"rollForward": false
}
}
}
1 change: 1 addition & 0 deletions .csharpierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.csproj
27 changes: 8 additions & 19 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<Project>

<PropertyGroup>
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
<BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory>
</PropertyGroup>

<PropertyGroup>
<Version>4.0.2</Version>
<Version>4.0.3</Version>
<AssemblyVersion>4.0.0</AssemblyVersion>
</PropertyGroup>

<PropertyGroup>
<Company>lepo.co</Company>
<Authors>lepo.co</Authors>
Expand All @@ -25,11 +22,9 @@
<RepositoryBranch>main</RepositoryBranch>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
<SourceRoot Include="$(MSBuildThisFileDirectory)/" />
</ItemGroup>

<PropertyGroup>
<NuGetAudit>true</NuGetAudit>
<NuGetAuditLevel>moderate</NuGetAuditLevel>
Expand All @@ -38,48 +33,44 @@
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<_SilenceIsAotCompatibleUnsupportedWarning>true</_SilenceIsAotCompatibleUnsupportedWarning>
</PropertyGroup>

<PropertyGroup>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>13.0</LangVersion>
<Nullable>enable</Nullable>

<!--
Suppress ref safety warnings in unsafe contexts (see https://github.com/dotnet/csharplang/issues/6476).
This is used eg. to replace Unsafe.SizeOf<T>() calls with just sizeof(T). The warning is not necessary
since in order to use these APIs the caller already has to be in an unsafe context.
-->
<NoWarn>$(NoWarn);CS8500</NoWarn>
</PropertyGroup>

<PropertyGroup>
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
<IsCoreProject Condition="$(IsTestProject)">False</IsCoreProject>
<IsCoreProject Condition="'$(IsCoreProject)' == ''">True</IsCoreProject>
<IsBelowNet8 Condition="'$(TargetFramework)' == 'netstandard2.0'
<IsBelowNet8
Condition="'$(TargetFramework)' == 'netstandard2.0'
Or '$(TargetFramework)' == 'netstandard2.1'
Or '$(TargetFramework)' == 'net462'
Or '$(TargetFramework)' == 'net472'
Or '$(TargetFramework)' == 'net481'
Or '$(TargetFramework)' == 'net5.0'
Or '$(TargetFramework)' == 'net6.0'
Or '$(TargetFramework)' == 'net7.0'">True</IsBelowNet8>
Or '$(TargetFramework)' == 'net7.0'"
>True</IsBelowNet8
>
</PropertyGroup>

<PropertyGroup>
<IsPackable>true</IsPackable>
<IsPublishable>true</IsPublishable>
<ContinuousIntegrationBuild>$(TF_BUILD)</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(IsBelowNet8)' == 'false'">
<DefineConstants>$(DefineConstants);NET8_0_OR_GREATER</DefineConstants>
</PropertyGroup>

<Choose>
<When Condition="$(IsCoreProject)">
<PropertyGroup>
Expand All @@ -95,7 +86,6 @@
</PropertyGroup>
</Otherwise>
</Choose>

<Choose>
<When Condition="'$(SourceLinkEnabled)' != 'false' and '$(VisualStudioTemplateProject)' != 'true'">
<PropertyGroup>
Expand All @@ -111,5 +101,4 @@
</ItemGroup>
</When>
</Choose>

</Project>
</Project>
21 changes: 10 additions & 11 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<Project>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup>
<CommonTags Condition="$(IsCoreProject)">$(CommonTags);.NET</CommonTags>
<PackageTags Condition="'$(PackageTags)' != ''">$(CommonTags);$(PackageTags)</PackageTags>
<PackageTags Condition="'$(PackageTags)' == ''">$(CommonTags)</PackageTags>
</PropertyGroup>

<PropertyGroup Condition="'$(GeneratePackageOnBuild)' == 'true'">
<GenerateLibraryLayout>true</GenerateLibraryLayout>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand All @@ -19,37 +16,39 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<ItemGroup Condition="'$(GeneratePackageOnBuild)' == 'true'">
<None Include="$(BuildToolsDirectory)nuget.png" Pack="true" PackagePath="\Icon.png" Visible="False" />
<None Include="$(RepositoryDirectory)ThirdPartyNotices.txt" Pack="true" PackagePath="\" Visible="False" />
<None Include="$(RepositoryDirectory)LICENSE.md" Pack="true" PackagePath="\LICENSE.md" Visible="False" />
<None Include="$(RepositoryDirectory)README.md" Pack="true" PackagePath="\README.md" Visible="False" />
</ItemGroup>

<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(SourceRevisionId)' != ''">
<AssemblyAttribute
Include="System.Reflection.AssemblyMetadataAttribute"
Condition="'$(SourceRevisionId)' != ''"
>
<_Parameter1>CommitHash</_Parameter1>
<_Parameter2>$(SourceRevisionId)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Target>

<!-- Configure trimming for projects on .NET 6 and above -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == 'net10.0'">
<IsTrimmable>true</IsTrimmable>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<EnableAotAnalyzer>true</EnableAotAnalyzer>
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
</PropertyGroup>

<PropertyGroup Condition="'$(SourceLinkEnabled)' == 'true' AND '$(GeneratePackageOnBuild)' == 'true'">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(RepositoryDirectory)\src\lepo.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<Target Name="WpfSourceLinkWorkaround" BeforeTargets="InitializeSourceRootMappedPaths" Condition="'$(UseWPF)' == 'true'">
<Target
Name="WpfSourceLinkWorkaround"
BeforeTargets="InitializeSourceRootMappedPaths"
Condition="'$(UseWPF)' == 'true'"
>
<!-- WPF causes an error with SourceLink because its build targets create a temporary project without a PackageReference to SourceLink, see https://github.com/dotnet/sourcelink/issues/91,
causing the @SourceRoot property to be unexpectedly empty for the MapSourceRoot task

Expand All @@ -63,4 +62,4 @@
<SourceRoot Include="\" />
</ItemGroup>
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
</ItemGroup>
</Project>
</Project>
2 changes: 0 additions & 2 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>

<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>

<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
Expand Down
2 changes: 1 addition & 1 deletion samples/Wpf.Ui.Demo.SetResources.Simple/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public static void ApplyTheme(FrameworkElement element)
element.Resources.MergedDictionaries.Add(ThemesDictionary);
element.Resources.MergedDictionaries.Add(ControlsDictionary);
}
}
}
4 changes: 2 additions & 2 deletions samples/Wpf.Ui.Demo.SetResources.Simple/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public partial class MainWindow
public MainWindow()
{
DataContext = this;

App.ApplyTheme(this);

InitializeComponent();

Loaded += (_, _) => RootNavigation.Navigate(typeof(DashboardPage));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public DataGroup(bool selected, string name, string groupName)
public bool Selected { get; set; }
public string Name { get; set; }
public string GroupName { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class DashboardPage
public DashboardPage()
{
App.ApplyTheme(this);

DataContext = this;
InitializeComponent();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class DataPage
public DataPage()
{
App.ApplyTheme(this);

InitializeData();
InitializeComponent();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ private void InitializeData()
GroupCollection.Add(new DataGroup(true, "Bugatti", "Auto"));
GroupCollection.Add(new DataGroup(false, "Lamborghini", "Auto"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public partial class SettingsPage
public SettingsPage()
{
App.ApplyTheme(this);

InitializeComponent();

AppVersionTextBlock.Text = $"WPF UI - Simple Demo - {GetAssemblyVersion()}";
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Extension.Template.Blank/Wpf.Ui.Blank.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="WPF-UI" Version="4.0.2" />
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.0.2" />
<PackageReference Include="WPF-UI" Version="4.0.3" />
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.0.3" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0 "/>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Extension.Template.Compact/Wpf.Ui.Compact.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="WPF-UI" Version="4.0.2" />
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.0.2" />
<PackageReference Include="WPF-UI" Version="4.0.3" />
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.0.3" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0 "/>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Extension.Template.Fluent/Wpf.Ui.Fluent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="WPF-UI" Version="4.0.2" />
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.0.2" />
<PackageReference Include="WPF-UI" Version="4.0.3" />
<PackageReference Include="WPF-UI.DependencyInjection" Version="4.0.3" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0 "/>
</ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/Wpf.Ui.Gallery/Controllers/MonacoController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ public void DispatchScript(string script)
return;
}

_ = Application.Current.Dispatcher.InvokeAsync(
async () => await _webView!.ExecuteScriptAsync(script)
_ = Application.Current.Dispatcher.InvokeAsync(async () => await _webView!.ExecuteScriptAsync(script)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public partial class AutoSuggestBoxViewModel : ViewModel
"Alexzander",
};

[ObservableProperty] private bool _showClearButton = true;
[ObservableProperty]
private bool _showClearButton = true;

[RelayCommand]
private void OnShowClearButtonChecked(object sender)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<FileList>
<File Reference="Wpf.Ui.ToastNotifications.dll">
<ToolboxItems UIFramework="WPF" VSCategory="WPF UI" BlendCategory="WPF UI">
</ToolboxItems>
<ToolboxItems UIFramework="WPF" VSCategory="WPF UI" BlendCategory="WPF UI"></ToolboxItems>
</File>
</FileList>
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Tray/VisualStudioToolsManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<Item Type="Wpf.Ui.Tray.Controls.NotifyIcon" />
</ToolboxItems>
</File>
</FileList>
</FileList>
7 changes: 3 additions & 4 deletions src/Wpf.Ui/Animations/AnimationProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ internal static class AnimationProperties
"AnimationTagValue",
typeof(double),
typeof(AnimationProperties),
new FrameworkPropertyMetadata(
0.0,
FrameworkPropertyMetadataOptions.Inherits));
new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.Inherits)
);

public static double GetAnimationTagValue(DependencyObject dp)
{
Expand All @@ -24,4 +23,4 @@ public static void SetAnimationTagValue(DependencyObject dp, double value)
{
dp.SetValue(AnimationTagValueProperty, value);
}
}
}
11 changes: 5 additions & 6 deletions src/Wpf.Ui/Controls/GridView/GridViewColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ namespace Wpf.Ui.Controls;
public class GridViewColumn : System.Windows.Controls.GridViewColumn
{
// use reflection to get the `_desiredWidth` private field.
private static readonly Lazy<FieldInfo> _desiredWidthField = new(
() =>
typeof(System.Windows.Controls.GridViewColumn).GetField(
"_desiredWidth",
BindingFlags.NonPublic | BindingFlags.Instance
) ?? throw new InvalidOperationException("The `_desiredWidth` field was not found.")
private static readonly Lazy<FieldInfo> _desiredWidthField = new(() =>
typeof(System.Windows.Controls.GridViewColumn).GetField(
"_desiredWidth",
BindingFlags.NonPublic | BindingFlags.Instance
) ?? throw new InvalidOperationException("The `_desiredWidth` field was not found.")
);

private static FieldInfo DesiredWidthField => _desiredWidthField.Value;
Expand Down
5 changes: 1 addition & 4 deletions src/Wpf.Ui/Controls/MessageBox/MessageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,7 @@ protected virtual void OnLoaded()
CenterWindowOnScreen();
break;
case WindowStartupLocation.CenterOwner:
if (
!CanCenterOverWPFOwner()
|| Owner.WindowState is WindowState.Minimized
)
if (!CanCenterOverWPFOwner() || Owner.WindowState is WindowState.Minimized)
{
CenterWindowOnScreen();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ internal class NavigationViewBreadcrumbItem : DependencyObject
nameof(Content),
typeof(object),
typeof(NavigationViewBreadcrumbItem),
new PropertyMetadata(null));
new PropertyMetadata(null)
);

public NavigationViewBreadcrumbItem(INavigationViewItem item)
{
Expand Down
Loading
Loading