mirror of
https://github.com/ckaczor/WorldClockStatusWindow.git
synced 2026-03-05 11:01:43 -05:00
Compare commits
3 Commits
v2024.10.2
...
v2026.3.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ab9994897 | |||
| aa9a7ef568 | |||
| a73a583ed7 |
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@@ -23,14 +23,14 @@ jobs:
|
||||
- name: Install .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 10.0.x
|
||||
|
||||
- name: Publish Application
|
||||
run: dotnet publish WorldClockStatusWindow.csproj -c Debug -o publish
|
||||
run: dotnet publish WorldClockStatusWindow.csproj -c Release -o publish
|
||||
|
||||
- name: Create Velopack Release
|
||||
run: |
|
||||
dotnet tool install -g vpk
|
||||
vpk download github --repoUrl https://github.com/ckaczor/WorldClockStatusWindow
|
||||
vpk pack -u WorldClockStatusWindow -v ${{ steps.version.outputs.version }} -p publish --packTitle "World Clock Status Window" --shortcuts StartMenuRoot --framework net8.0-x64-desktop
|
||||
vpk pack -u WorldClockStatusWindow -v ${{ steps.version.outputs.version }} -p publish --packTitle "World Clock Status Window" --shortcuts StartMenuRoot --framework net10.0-x64-desktop
|
||||
vpk upload github --repoUrl https://github.com/ckaczor/WorldClockStatusWindow --publish --releaseName "${{ steps.version.outputs.version }}" --tag v${{ steps.version.outputs.version }} --token ${{ secrets.GITHUB_TOKEN }}
|
||||
2
Data.cs
2
Data.cs
@@ -6,7 +6,7 @@ namespace WorldClockStatusWindow;
|
||||
|
||||
internal static class Data
|
||||
{
|
||||
internal static ObservableCollection<TimeZoneEntry> TimeZoneEntries { get; set; }
|
||||
internal static ObservableCollection<TimeZoneEntry> TimeZoneEntries { get; private set; }
|
||||
|
||||
internal static void Load()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
mc:Ignorable="d"
|
||||
Title="TimeZoneWindow"
|
||||
ResizeMode="NoResize"
|
||||
@@ -42,12 +43,26 @@
|
||||
mah:TextBoxHelper.SelectAllOnFocus="True"
|
||||
Text="{Binding Path=Label, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}" />
|
||||
<ComboBox Name="TimeZoneComboBox"
|
||||
DisplayMemberPath="DisplayName"
|
||||
SelectedValuePath="Id"
|
||||
SelectedValue="{Binding Path=TimeZoneId}"
|
||||
VirtualizingPanel.IsVirtualizing="False"
|
||||
mah:TextBoxHelper.UseFloatingWatermark="True"
|
||||
mah:TextBoxHelper.Watermark="{x:Static properties:Resources.TimeZoneColumnHeader}" />
|
||||
mah:TextBoxHelper.Watermark="{x:Static properties:Resources.TimeZoneColumnHeader}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="system:TimeZoneInfo">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Path=DisplayName}"
|
||||
Height="Auto"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock Text="{Binding Path=Id}"
|
||||
Height="Auto"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,2" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
@@ -62,7 +77,8 @@
|
||||
IsDefault="True"
|
||||
Click="HandleOkayButtonClick">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Style TargetType="Button"
|
||||
BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Text.Length, ElementName=LabelTextBox}"
|
||||
Value="0">
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:worldClockStatusWindow="clr-namespace:WorldClockStatusWindow"
|
||||
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
|
||||
xmlns:controls="clr-namespace:ChrisKaczor.Wpf.Controls;assembly=ChrisKaczor.Wpf.Controls.Link"
|
||||
xmlns:dd="urn:gong-wpf-dragdrop"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="150"
|
||||
d:DesignWidth="300">
|
||||
@@ -36,21 +37,37 @@
|
||||
GridLinesVisibility="None"
|
||||
CanUserResizeRows="False"
|
||||
IsReadOnly="True"
|
||||
CanUserSortColumns="False"
|
||||
SelectionUnit="FullRow"
|
||||
HeadersVisibility="Column"
|
||||
BorderThickness="1,1,1,1"
|
||||
BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
|
||||
Background="{x:Null}"
|
||||
SelectionChanged="HandleTimeZoneDataGridSelectionChanged"
|
||||
d:DataContext="{d:DesignInstance worldClockStatusWindow:TimeZoneEntry }">
|
||||
d:DataContext="{d:DesignInstance worldClockStatusWindow:TimeZoneEntry }"
|
||||
dd:DragDrop.IsDragSource="True"
|
||||
dd:DragDrop.IsDropTarget="True">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding Path=Label}"
|
||||
Header="{x:Static properties:Resources.LabelColumnHeader}"
|
||||
SortDirection="Ascending"
|
||||
Width="*" />
|
||||
<DataGridTextColumn Binding="{Binding TimeZoneId}"
|
||||
Header="{x:Static properties:Resources.TimeZoneColumnHeader}"
|
||||
Width="*" />
|
||||
<DataGridTemplateColumn Header="{x:Static properties:Resources.TimeZoneColumnHeader}"
|
||||
Width="*">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Path=TimeZoneInfo.DisplayName}"
|
||||
Height="Auto"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock Text="{Binding Path=TimeZoneInfo.Id}"
|
||||
Height="Auto"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,2" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
@@ -25,7 +24,6 @@ public partial class TimeZonesSettingsPanel
|
||||
if (_collectionViewSource == null)
|
||||
{
|
||||
_collectionViewSource = new CollectionViewSource { Source = Data.TimeZoneEntries };
|
||||
_collectionViewSource.SortDescriptions.Add(new SortDescription("Label", ListSortDirection.Ascending));
|
||||
|
||||
TimeZoneDataGrid.ItemsSource = _collectionViewSource.View;
|
||||
}
|
||||
|
||||
@@ -16,17 +16,15 @@ public class TimeZoneEntry : INotifyDataErrorInfo
|
||||
_dataErrorDictionary.ErrorsChanged += DataErrorDictionaryErrorsChanged;
|
||||
}
|
||||
|
||||
private string _label;
|
||||
|
||||
public string Label
|
||||
{
|
||||
get => _label;
|
||||
get;
|
||||
set
|
||||
{
|
||||
if (!ValidateLabel(value))
|
||||
return;
|
||||
|
||||
_label = value;
|
||||
field = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +33,9 @@ public class TimeZoneEntry : INotifyDataErrorInfo
|
||||
[JsonIgnore]
|
||||
public bool HasErrors => _dataErrorDictionary.Any();
|
||||
|
||||
[JsonIgnore]
|
||||
public TimeZoneInfo TimeZoneInfo => TimeZoneInfo.FindSystemTimeZoneById(TimeZoneId);
|
||||
|
||||
public IEnumerable GetErrors(string propertyName)
|
||||
{
|
||||
return _dataErrorDictionary.GetErrors(propertyName);
|
||||
|
||||
@@ -156,10 +156,7 @@ internal class WindowSource : IWindowSource, IDisposable
|
||||
|
||||
var settingsWindow = new CategoryWindow(categoryPanels, Resources.SettingsTitle, Resources.CloseButtonText);
|
||||
|
||||
var dialogResult = settingsWindow.ShowDialog();
|
||||
|
||||
if (!dialogResult.GetValueOrDefault(false))
|
||||
return;
|
||||
settingsWindow.ShowDialog();
|
||||
|
||||
Save();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows7.0</TargetFramework>
|
||||
<TargetFramework>net10.0-windows7.0</TargetFramework>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<UseWPF>true</UseWPF>
|
||||
@@ -19,8 +19,8 @@
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Controls.Link" Version="1.0.4" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Validation" Version="1.0.4" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Windows.CategoryWindow" Version="1.0.2" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Windows.FloatingStatusWindow" Version="2.0.0.5" />
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Windows.FloatingStatusWindow" Version="2.0.0.9" />
|
||||
<PackageReference Include="gong-wpf-dragdrop" Version="3.2.1" />
|
||||
<PackageReference Include="Serilog" Version="4.0.2" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||
|
||||
Reference in New Issue
Block a user