Skip to content

Commit

Permalink
Merge pull request #781 from lepoco/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
pomianowski committed Oct 9, 2023
2 parents 5a67397 + f465d5f commit bb3933b
Show file tree
Hide file tree
Showing 238 changed files with 3,666 additions and 4,120 deletions.
11 changes: 0 additions & 11 deletions .clabot

This file was deleted.

10 changes: 10 additions & 0 deletions .csharpierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 130,
"useTabs": false,
"tabWidth": 4,
"preprocessorSymbolSets": [
"",
"DEBUG",
"DEBUG,CODE_STYLE"
]
}
25 changes: 25 additions & 0 deletions .github/policies/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Contributor License Agreement Policy
description: CLA policy file

resource: repository

configuration:
cla:
content: https://raw.githubusercontent.com/lepoco/.github/main/CLA/lepoco.yml
minimalChangeRequired:
files: 1
codeLines: 1
bypassUsers:
- azclibot
- azure-pipelines[bot]
- azure-pipelines-bot
- azure-powershell-bot
- azuresdkciprbot
- dependabot[bot]
- dependabot-preview[bot]
- dotnet-bot
- dotnet-corert-bot
- dotnet-docker-bot
- dotnet-maestro[bot]
- dotnet-maestro-bot
- dotnet-winget-bot
10 changes: 10 additions & 0 deletions .github/policies/platformcontext.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: platform_context
description: The context for GitOps platform, this will drive GitOps specific policies
owner:
resource: repository
where:
configuration:
platformContext:
active: true
onFailure:
onSuccess:
2 changes: 1 addition & 1 deletion .github/workflows/wpf-ui-cd-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Use Node.js 18.x
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wpf-ui-cd-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v1.3
with:
msbuild-architecture: x64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wpf-ui-cd-nuget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
deploy:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v1.3
with:
msbuild-architecture: x64
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wpf-ui-pr-validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v1.3
with:
msbuild-architecture: x64
Expand Down
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.0-preview.6</Version>
<Version>3.0.0-preview.7</Version>
<LangVersion>11.0</LangVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.4.2118" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.1462.37" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="NativeMethods" Version="0.0.3" />
<PackageVersion Include="NSubstitute" Version="5.0.0" />
<PackageVersion Include="PolySharp" Version="1.13.2" />
<PackageVersion Include="WpfAnalyzers" Version="4.1.1" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
<PackageVersion Include="WpfAnalyzers" Version="4.1.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="xunit" Version="2.4.2" />
</ItemGroup>
</Project>
</Project>
6 changes: 4 additions & 2 deletions Settings.XamlStyler
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"SeparateByGroups": false,
"AttributeIndentation": 0,
"AttributeIndentationStyle": 1,
"RemoveDesignTimeReferences": false,
"RemoveDesignTimeReferences": false,
"IgnoreDesignTimeReferencePrefix": false,
"EnableAttributeReordering": true,
"AttributeOrderingRuleGroups": [
Expand Down Expand Up @@ -38,5 +38,7 @@
"ThicknessSeparator": 2,
"ThicknessAttributes": "Margin, Padding, BorderThickness, ThumbnailClipMargin",
"FormatOnSave": true,
"CommentPadding": 2
"CommentPadding": 2,
"IndentSize": 4,
"IndentWithTabs": false
}
6 changes: 1 addition & 5 deletions docs/codesnippet/Rtf/Hyperlink/RtfDocumentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ private static HashSet<string> CollectLinksAndFixDocument(FileModel model)
#endregion

#region FixLink
private static void FixLink(
XAttribute link,
RelativePath filePath,
HashSet<string> linkToFiles
)
private static void FixLink(XAttribute link, RelativePath filePath, HashSet<string> linkToFiles)
{
string linkFile;
string anchor = null;
Expand Down
4 changes: 1 addition & 3 deletions docs/codesnippet/Rtf/RtfBuildStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ public class RtfBuildStep : IDocumentBuildStep
public void Build(FileModel model, IHostService host)
{
string content = (string)((Dictionary<string, object>)model.Content)["conceptual"];
content = _taskFactory
.StartNew(() => RtfToHtmlConverter.ConvertRtfToHtml(content))
.Result;
content = _taskFactory.StartNew(() => RtfToHtmlConverter.ConvertRtfToHtml(content)).Result;
((Dictionary<string, object>)model.Content)["conceptual"] = content;
}
#endregion
Expand Down
6 changes: 1 addition & 5 deletions docs/codesnippet/Rtf/RtfDocumentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ public FileModel Load(FileAndType file, ImmutableDictionary<string, object> meta
#region Save
public SaveResult Save(FileModel model)
{
return new SaveResult
{
DocumentType = "Conceptual",
FileWithoutExtension = Path.ChangeExtension(model.File, null),
};
return new SaveResult { DocumentType = "Conceptual", FileWithoutExtension = Path.ChangeExtension(model.File, null), };
}
#endregion

Expand Down
2 changes: 1 addition & 1 deletion docs/templates/wpfui/src/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function renderNavbar(): Promise<NavItem[]> {
<form class="icons">
${window.docfx.iconLinks?.map(i => html`<a href="${i.href}" title="${i.title}" class="btn border-0"><i class="bi bi-${i.icon}"></i></a>`)}
${themePicker(renderCore)}
<a class="btn btn-border-0 btn-sponsor mr-05" rel="noopener noreferrer" href="https://github.com/sponsors/lepoco">Sponsor</a>
<a class="btn btn-border-0 btn-colorful mr-05" rel="noopener noreferrer" href="https://github.com/sponsors/lepoco">Sponsor</a>
</form>`

render(html`${menu} ${icons}`, navbar)
Expand Down
23 changes: 14 additions & 9 deletions docs/templates/wpfui/src/wpfui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ h5 {
rgb(19, 104, 145) 50%,
rgb(32, 135, 135) 75%
);
transition: background-position 0.5s ease-in-out;
background-size: 200% 200%;
background-position: 0% 0%;

&:hover {
background-position: 100% 100%;
}
}

.btn-colorful {
Expand All @@ -48,16 +55,14 @@ h5 {
rgb(19, 104, 145) 50%,
rgb(32, 135, 135) 75%
);
}
transition: background-position 0.5s ease-in-out;
background-size: 200% 200%;
background-position: 0% 0%;
color: white;

.btn-sponsor {
background-color: rgb(15, 163, 180);
background-image: linear-gradient(
140deg,
rgb(0, 128, 154),
rgb(19, 104, 145) 50%,
rgb(32, 135, 135) 75%
);
&:hover {
background-position: 100% 100%;
}
}

img {
Expand Down
5 changes: 1 addition & 4 deletions src/Wpf.Ui.Demo.Mvvm/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ private async void OnExit(object sender, ExitEventArgs e)
/// <summary>
/// Occurs when an exception is thrown by an application but not handled.
/// </summary>
private void OnDispatcherUnhandledException(
object sender,
DispatcherUnhandledExceptionEventArgs e
)
private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
// For more info see https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.dispatcherunhandledexception?view=windowsdesktop-6.0
}
Expand Down
4 changes: 1 addition & 3 deletions src/Wpf.Ui.Demo.Mvvm/Services/ApplicationHostService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ private async Task HandleActivationAsync()

if (!Application.Current.Windows.OfType<MainWindow>().Any())
{
_navigationWindow = (
_serviceProvider.GetService(typeof(INavigationWindow)) as INavigationWindow
)!;
_navigationWindow = (_serviceProvider.GetService(typeof(INavigationWindow)) as INavigationWindow)!;
_navigationWindow!.ShowWindow();

_navigationWindow.Navigate(typeof(Views.Pages.DashboardPage));
Expand Down
7 changes: 1 addition & 6 deletions src/Wpf.Ui.Demo.Mvvm/ViewModels/DataViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ private void InitializeViewModel()
new DataColor
{
Color = new SolidColorBrush(
Color.FromArgb(
(byte)200,
(byte)random.Next(0, 250),
(byte)random.Next(0, 250),
(byte)random.Next(0, 250)
)
Color.FromArgb((byte)200, (byte)random.Next(0, 250), (byte)random.Next(0, 250), (byte)random.Next(0, 250))
)
}
);
Expand Down
16 changes: 4 additions & 12 deletions src/Wpf.Ui.Demo.Mvvm/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ public partial class SettingsViewModel : ObservableObject, INavigationAware
private string _appVersion = String.Empty;

[ObservableProperty]
private Wpf.Ui.Appearance.ApplicationTheme _currentApplicationTheme = Wpf.Ui
.Appearance
.ApplicationTheme
.Unknown;
private Wpf.Ui.Appearance.ApplicationTheme _currentApplicationTheme = Wpf.Ui.Appearance.ApplicationTheme.Unknown;

public void OnNavigatedTo()
{
Expand All @@ -38,8 +35,7 @@ private void InitializeViewModel()

private string GetAssemblyVersion()
{
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString()
?? String.Empty;
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? String.Empty;
}

[RelayCommand]
Expand All @@ -51,9 +47,7 @@ private void OnChangeTheme(string parameter)
if (CurrentApplicationTheme == Wpf.Ui.Appearance.ApplicationTheme.Light)
break;

Wpf.Ui.Appearance.ApplicationThemeManager.Apply(
Wpf.Ui.Appearance.ApplicationTheme.Light
);
Wpf.Ui.Appearance.ApplicationThemeManager.Apply(Wpf.Ui.Appearance.ApplicationTheme.Light);
CurrentApplicationTheme = Wpf.Ui.Appearance.ApplicationTheme.Light;

break;
Expand All @@ -62,9 +56,7 @@ private void OnChangeTheme(string parameter)
if (CurrentApplicationTheme == Wpf.Ui.Appearance.ApplicationTheme.Dark)
break;

Wpf.Ui.Appearance.ApplicationThemeManager.Apply(
Wpf.Ui.Appearance.ApplicationTheme.Dark
);
Wpf.Ui.Appearance.ApplicationThemeManager.Apply(Wpf.Ui.Appearance.ApplicationTheme.Dark);
CurrentApplicationTheme = Wpf.Ui.Appearance.ApplicationTheme.Dark;

break;
Expand Down
9 changes: 2 additions & 7 deletions src/Wpf.Ui.Demo.Mvvm/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ public partial class MainWindow : INavigationWindow
{
public ViewModels.MainWindowViewModel ViewModel { get; }

public MainWindow(
ViewModels.MainWindowViewModel viewModel,
IPageService pageService,
INavigationService navigationService
)
public MainWindow(ViewModels.MainWindowViewModel viewModel, IPageService pageService, INavigationService navigationService)
{
ViewModel = viewModel;
DataContext = this;
Expand All @@ -37,8 +33,7 @@ INavigationService navigationService

public bool Navigate(Type pageType) => RootNavigation.Navigate(pageType);

public void SetPageService(IPageService pageService) =>
RootNavigation.SetPageService(pageService);
public void SetPageService(IPageService pageService) => RootNavigation.SetPageService(pageService);

public void ShowWindow() => Show();

Expand Down
10 changes: 2 additions & 8 deletions src/Wpf.Ui.Demo.Simple/Views/Pages/DashboardPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,11 @@ public DashboardPage()
DataContext = this;
InitializeComponent();

CounterTextBlock.SetCurrentValue(
System.Windows.Controls.TextBlock.TextProperty,
_counter.ToString()
);
CounterTextBlock.SetCurrentValue(System.Windows.Controls.TextBlock.TextProperty, _counter.ToString());
}

private void OnBaseButtonClick(object sender, RoutedEventArgs e)
{
CounterTextBlock.SetCurrentValue(
System.Windows.Controls.TextBlock.TextProperty,
(++_counter).ToString()
);
CounterTextBlock.SetCurrentValue(System.Windows.Controls.TextBlock.TextProperty, (++_counter).ToString());
}
}
7 changes: 1 addition & 6 deletions src/Wpf.Ui.Demo.Simple/Views/Pages/DataPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ private void InitializeData()
new DataColor
{
Color = new SolidColorBrush(
Color.FromArgb(
(byte)200,
(byte)random.Next(0, 250),
(byte)random.Next(0, 250),
(byte)random.Next(0, 250)
)
Color.FromArgb((byte)200, (byte)random.Next(0, 250), (byte)random.Next(0, 250), (byte)random.Next(0, 250))
)
}
);
Expand Down
3 changes: 1 addition & 2 deletions src/Wpf.Ui.Demo.Simple/Views/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ private void OnDarkThemeRadioButtonChecked(object sender, RoutedEventArgs e)

private string GetAssemblyVersion()
{
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString()
?? String.Empty;
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? String.Empty;
}
}
Loading

0 comments on commit bb3933b

Please sign in to comment.