Skip to content

Commit

Permalink
Refactor libraries, update README, add new classes
Browse files Browse the repository at this point in the history
The commit involves refactoring the directories of WPF controls and utilities in the Frank.Libraries.Wpf project. The properties of several csproj files were moved to the Directory.Build.props file for better management. Two classes (Class1) were deleted from CodeEditing and Markdown directories. README was updated with new badges. New classes (PageTabs, IconButton) were added and namespaces were corrected in several files.
  • Loading branch information
frankhaugen committed Dec 25, 2023
1 parent 79c12e0 commit 79ec090
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 49 deletions.
38 changes: 35 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
<Project>
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
<PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>true</IsPackable>

<Description>A library of WPF controls and utilities for .NET 8.0 and later. Fundamentally, this library is a collection of controls and utilities that I have found useful in my own projects. I hope you find them useful as well.</Description>
<PackageTags>WPF, UI, TextInput, CodeEditor, Page, Markdown, Library, Controls, Utilities, Frank, Haugen</PackageTags>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>

</PropertyGroup>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>

<Authors>Frank R. Haugen</Authors>
<PublisherName>Frank R. Haugen</PublisherName>
<Copyright>Copyright (c) 2023 Frank R. Haugen</Copyright>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://www.github.com/frankhaugen/Frank.Libraries.Wpf</PackageProjectUrl>

<RepositoryUrl>https://www.github.com/frankhaugen/Frank.Libraries.Wpf</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<None Include="../readme.md" Pack="true" PackagePath="\"/>
<None Include="../icon.png" Pack="true" PackagePath="\"/>
<InternalsVisibleTo Include="$(AssemblyName).Tests"/>
<InternalsVisibleTo Include="LINQPadQuery"/>
</ItemGroup>
</Project>
5 changes: 0 additions & 5 deletions Frank.Libraries.Wpf.CodeEditing/Class1.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AvalonEdit" Version="6.3.0.90" />
<PackageReference Include="RoslynPad.Editor.Windows" Version="4.8.0" />
Expand Down
2 changes: 1 addition & 1 deletion Frank.Libraries.Wpf.CodeEditing/Pages/RoslynPadPage.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Windows;
using System.Windows.Controls;

namespace Frank.Libraries.Wpf.Pages;
namespace Frank.Libraries.Wpf.CodeEditing.Pages;

public class RoslynPadPage : Page
{
Expand Down
5 changes: 0 additions & 5 deletions Frank.Libraries.Wpf.Markdown/Class1.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>

<PackageReference Include="Markdig.Wpf" Version="0.5.0.1" />
</ItemGroup>

Expand Down
16 changes: 4 additions & 12 deletions Frank.Libraries.Wpf.Markdown/Pages/MarkdownPreviewPage.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Windows;
using System.Windows.Controls;

namespace Frank.Libraries.Wpf.Pages;
namespace Frank.Libraries.Wpf.Markdown.Pages;

public class MarkdownPreviewPage : Page
{
Expand All @@ -14,19 +14,11 @@ public MarkdownPreviewPage()

public string Markdown
{
get => (string)GetValue(MarkdownProperty);
set => SetValue(MarkdownProperty, value);
get => (string)GetValue(MarkdownProperty ?? throw new InvalidOperationException());
set => SetValue(MarkdownProperty ?? throw new InvalidOperationException(), value);
}

public DependencyProperty MarkdownProperty { get; set; }

private async void FileContextOnSaved(string obj)
{
if (obj is null) return;
UpdatePreview();
}

private async void FileContextOnSelectedChanged() => UpdatePreview();
public DependencyProperty? MarkdownProperty { get; set; }

public async void UpdatePreview()

Check warning on line 23 in Frank.Libraries.Wpf.Markdown/Pages/MarkdownPreviewPage.cs

View workflow job for this annotation

GitHub Actions / Merge Job

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 23 in Frank.Libraries.Wpf.Markdown/Pages/MarkdownPreviewPage.cs

View workflow job for this annotation

GitHub Actions / Release Job

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
Expand Down
11 changes: 11 additions & 0 deletions Frank.Libraries.Wpf.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frank.Libraries.Wpf.Markdow
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frank.Libraries.Wpf.CodeEditing", "Frank.Libraries.Wpf.CodeEditing\Frank.Libraries.Wpf.CodeEditing.csproj", "{DF7444EC-5E31-466E-96AA-3B3D71A3A8CF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E96924C0-C267-4114-8E5B-A3C6020F2BCF}"
ProjectSection(SolutionItems) = preProject
.github\workflows\main.yml = .github\workflows\main.yml
.editorconfig = .editorconfig
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
LICENSE = LICENSE
nuget.config = nuget.config
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion Frank.Libraries.Wpf/Commands/AsyncRelayCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Windows.Input;

namespace Frank.ServiceBusExplorer.Gui.Commands;
namespace Frank.Libraries.Wpf.Commands;

public class AsyncRelayCommand(Func<Task> execute, Func<bool>? canExecute = null) : ICommand
{
Expand Down
2 changes: 1 addition & 1 deletion Frank.Libraries.Wpf/Commands/RelayCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Windows.Input;

namespace Frank.ServiceBusExplorer.Gui.Commands;
namespace Frank.Libraries.Wpf.Commands;

public class RelayCommand(Action<object> execute, Predicate<object>? canExecute = null) : ICommand
{
Expand Down
4 changes: 0 additions & 4 deletions Frank.Libraries.Wpf/Frank.Libraries.Wpf.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Frank.Libraries.Wpf/Inputs/Buttons/IconButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
using System.Windows.Input;
using System.Windows.Media;

using Frank.ServiceBusExplorer.Gui.Commands;
using Frank.Libraries.Wpf.Commands;

using Material.Icons;
using Material.Icons.WPF;

namespace Frank.ServiceBusExplorer.Gui.UserControls;
namespace Frank.Libraries.Wpf.Inputs.Buttons;

public class IconButton : Button
{
Expand Down
8 changes: 8 additions & 0 deletions Frank.Libraries.Wpf/Tabs/PageTabs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System.Windows.Controls;

namespace Frank.Libraries.Wpf.Tabs;

public class PageTabs : TabControl
{

}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# Frank.Libraries.Wpf
Just a collections of WPF components that I have built over the years
___
[![GitHub License](https://img.shields.io/github/license/frankhaugen/Frank.Libraries.Wpf)](LICENSE)
[![NuGet](https://img.shields.io/nuget/v/Frank.Libraries.Wpf.svg)](https://www.nuget.org/packages/Frank.Libraries.Wpf)
[![NuGet](https://img.shields.io/nuget/dt/Frank.Libraries.Wpf.svg)](https://www.nuget.org/packages/Frank.Libraries.Wpf)

![GitHub contributors](https://img.shields.io/github/contributors/frankhaugen/Frank.Libraries.Wpf)
![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/frankhaugen/Frank.Libraries.Wpf)
![GitHub last commit](https://img.shields.io/github/last-commit/frankhaugen/Frank.Libraries.Wpf)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/frankhaugen/Frank.Libraries.Wpf)
![GitHub pull requests](https://img.shields.io/github/issues-pr/frankhaugen/Frank.Libraries.Wpf)
![GitHub issues](https://img.shields.io/github/issues/frankhaugen/Frank.Libraries.Wpf)
![GitHub closed issues](https://img.shields.io/github/issues-closed/frankhaugen/Frank.Libraries.Wpf)
___
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79ec090

Please sign in to comment.