├── IPConfig
├── Resources
│ ├── sun_3d.png
│ ├── ipconfig.ico
│ ├── network-tree.ai
│ ├── network-tree.png
│ ├── artist_palette_3d.png
│ ├── crescent_moon_3d.png
│ ├── inetcpl.cpl(4487).png
│ ├── purple_circle_3d.png
│ ├── shell32.dll(22).png
│ └── Screenshots
│ │ └── mainwindow.png
├── Languages
│ ├── Lang.Designer.cs
│ ├── Lang.Designer.tt
│ ├── LangExtension.cs
│ └── LangSource.cs
├── Models
│ ├── Messages
│ │ ├── ISender.cs
│ │ ├── SaveMessage.cs
│ │ ├── EmptyMessage.cs
│ │ ├── GoBackMessage.cs
│ │ ├── RefreshMessage.cs
│ │ ├── CancelEditMessage.cs
│ │ ├── ToggleStateMessage.cs
│ │ ├── ChangeSelectionMessage.cs
│ │ ├── AddUntitledIPConfigMessage.cs
│ │ ├── CollectionChangeActionMessage.cs
│ │ └── KeyPressMessage.cs
│ ├── GitHub
│ │ ├── GitHubReleaseInfo.cs
│ │ ├── GitHubApiException.cs
│ │ └── GitHubApi.cs
│ ├── IDeepCloneable.cs
│ ├── IDeepCloneTo.cs
│ ├── Validations
│ │ ├── IPValidationAttribute.cs
│ │ ├── ForwardingErrorsAttribute.cs
│ │ ├── ValidationLangAttributeBase.cs
│ │ └── RequiredIfAttribute.cs
│ ├── IPv4Mask.cs
│ ├── SimpleNicType.cs
│ ├── IPv6AdvancedConfig.cs
│ ├── LastUsedIPv4Config.cs
│ ├── IPv4AdvancedConfig.cs
│ ├── IPAdvancedConfigBase.cs
│ ├── Error.cs
│ ├── IPv4Dns.cs
│ ├── IPv4Config.cs
│ ├── EditableIPConfigModel.cs
│ ├── IPConfigBase.cs
│ ├── IPConfigModel.cs
│ └── Nic.cs
├── ViewModels
│ ├── StatusBarViewModel.cs
│ ├── ThemeSwitchButtonViewModel.cs
│ ├── VersionInfoViewModel.cs
│ └── MainViewModel.cs
├── Extensions
│ ├── StringExtensions.cs
│ ├── WindowsThemeExtensions.cs
│ ├── IPConfigModelExtensions.cs
│ └── EnumerableExtensions.cs
├── Themes
│ ├── MyDarkTheme.xaml
│ ├── MyLightTheme.xaml
│ ├── MyVioletTheme.xaml
│ └── MyResources.xaml
├── Helpers
│ ├── ResourceHelper.cs
│ ├── FileOrderHelper.cs
│ ├── ClipboardHelper.cs
│ ├── NameOfHelper.cs
│ ├── GroupItemHelper.cs
│ ├── UriHelper.cs
│ ├── BytesFormatter.cs
│ ├── LiteDbHelper.cs
│ ├── ThemeWatcher.cs
│ └── ThemeManager.cs
├── Converters
│ ├── StringToIntConverter.cs
│ ├── CopyContentFormatConverter.cs
│ ├── MultiValueEqualsConverter.cs
│ ├── SelectedNicIPConfigNameConverter.cs
│ ├── NicIPConfigToolTipConverter.cs
│ ├── BytesToFileSizeConverter.cs
│ ├── GetIPCIDRConverter.cs
│ ├── StringRemoveNewLineConverter.cs
│ ├── PingDnsGroupIsEnabledConverter.cs
│ ├── SkinTypeToolTipConverter.cs
│ ├── PingDnsLabelContentConverter.cs
│ ├── PingReplyToolTipConverter.cs
│ ├── ValidationErrorsToolTipConverter.cs
│ ├── SkinTypeToImageConverter.cs
│ ├── PingDnsLabelStyleConverter.cs
│ └── OperationalStatusToolTipConverter.cs
├── Views
│ ├── StatusBarView.xaml.cs
│ ├── NicInfoCardView.xaml.cs
│ ├── NicSelectorView.xaml.cs
│ ├── VersionInfoView.xaml.cs
│ ├── NicSpeedMonitorView.xaml.cs
│ ├── IPConfigListSelectionCounterView.xaml.cs
│ ├── ThemeSwitchButtonView.xaml.cs
│ ├── IPConfigListSelectionCounterView.xaml
│ ├── IPConfigDetailView.xaml.cs
│ ├── NicConfigDetailView.xaml.cs
│ ├── NicSpeedMonitorView.xaml
│ ├── IPv4ConfigView.xaml.cs
│ ├── MainWindow.xaml.cs
│ ├── IPConfigListView.xaml.cs
│ ├── VersionInfoView.xaml
│ ├── ThemeSwitchButtonView.xaml
│ └── StatusBarView.xaml
├── AssemblyInfo.cs
├── Properties
│ ├── Settings.settings
│ ├── Settings.cs
│ └── Settings.Designer.cs
├── .mask
│ ├── ipv4_mask.zh-CN.csv
│ └── ipv4_mask.en.csv
├── Controls
│ ├── BindingProxy.cs
│ ├── DeferredContent.cs
│ ├── ReadOnlyComboBox.cs
│ └── AlignDashCornerRect.cs
├── App.xaml
├── Behaviors
│ ├── TripleClickToSelectAllBehavior.cs
│ ├── CopyContentsSplitButtonBehavior.cs
│ ├── SplitButtonToggleDropDownBehavior.cs
│ ├── IgnoreMouseWheelBehavior.cs
│ ├── ContextMenuLeftClickBehavior.cs
│ ├── SelectedItemsBehavior.cs
│ └── InputBindingBehavior.cs
├── app.manifest
├── .dns
│ ├── ipv4_public_dns.zh-CN.csv
│ └── ipv4_public_dns.en.csv
└── IPConfig.csproj
├── Directory.Build.props
├── LICENSE
├── README.md
├── IPConfig.sln
└── .gitattributes
/IPConfig/Resources/sun_3d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/sun_3d.png
--------------------------------------------------------------------------------
/IPConfig/Resources/ipconfig.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/ipconfig.ico
--------------------------------------------------------------------------------
/IPConfig/Languages/Lang.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Languages/Lang.Designer.cs
--------------------------------------------------------------------------------
/IPConfig/Resources/network-tree.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/network-tree.ai
--------------------------------------------------------------------------------
/IPConfig/Resources/network-tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/network-tree.png
--------------------------------------------------------------------------------
/IPConfig/Resources/artist_palette_3d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/artist_palette_3d.png
--------------------------------------------------------------------------------
/IPConfig/Resources/crescent_moon_3d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/crescent_moon_3d.png
--------------------------------------------------------------------------------
/IPConfig/Resources/inetcpl.cpl(4487).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/inetcpl.cpl(4487).png
--------------------------------------------------------------------------------
/IPConfig/Resources/purple_circle_3d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/purple_circle_3d.png
--------------------------------------------------------------------------------
/IPConfig/Resources/shell32.dll(22).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/shell32.dll(22).png
--------------------------------------------------------------------------------
/IPConfig/Resources/Screenshots/mainwindow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingOctocat/IPConfig/HEAD/IPConfig/Resources/Screenshots/mainwindow.png
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/ISender.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public interface ISender
4 | {
5 | object Sender { get; }
6 | }
7 |
--------------------------------------------------------------------------------
/IPConfig/Languages/Lang.Designer.tt:
--------------------------------------------------------------------------------
1 | <#@ template debug="false" hostspecific="true" language="C#" #>
2 | <#@ include file="$(SolutionDir)Languages.Designer.t4" #>
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/SaveMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public class SaveMessage(object sender) : ISender
4 | {
5 | public object Sender { get; } = sender;
6 | }
7 |
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/EmptyMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public class EmptyMessage(object sender) : ISender
4 | {
5 | public object Sender { get; } = sender;
6 | }
7 |
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/GoBackMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public class GoBackMessage(object sender) : ISender
4 | {
5 | public object Sender { get; } = sender;
6 | }
7 |
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/RefreshMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public class RefreshMessage(object sender) : ISender
4 | {
5 | public object Sender { get; } = sender;
6 | }
7 |
--------------------------------------------------------------------------------
/IPConfig/ViewModels/StatusBarViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace IPConfig.ViewModels;
4 |
5 | public partial class StatusBarViewModel : ObservableObject
6 | { }
7 |
--------------------------------------------------------------------------------
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildProjectDirectory)=$(MSBuildProjectName)
5 |
6 |
7 |
--------------------------------------------------------------------------------
/IPConfig/Models/GitHub/GitHubReleaseInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace IPConfig.Models.GitHub;
4 |
5 | public record GitHubReleaseInfo(string TagName, string Name, string ReleaseNote, DateTimeOffset PublishedAt, string HtmlUrl);
6 |
--------------------------------------------------------------------------------
/IPConfig/Models/IDeepCloneable.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models;
2 |
3 | ///
4 | /// 支持深层克隆。
5 | ///
6 | ///
7 | public interface IDeepCloneable
8 | {
9 | T DeepClone();
10 | }
11 |
--------------------------------------------------------------------------------
/IPConfig/Models/IDeepCloneTo.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models;
2 |
3 | ///
4 | /// 支持深层克隆。
5 | ///
6 | ///
7 | public interface IDeepCloneTo
8 | {
9 | void DeepCloneTo(T other);
10 | }
11 |
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/CancelEditMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public class CancelEditMessage(object sender, bool ask) : ISender
4 | {
5 | public bool Ask { get; } = ask;
6 |
7 | public object Sender { get; } = sender;
8 | }
9 |
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/ToggleStateMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public class ToggleStateMessage(object sender, T newValue) : ISender
4 | {
5 | public T NewValue { get; } = newValue;
6 |
7 | public object Sender { get; } = sender;
8 | }
9 |
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/ChangeSelectionMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public class ChangeSelectionMessage(object sender, T selection) : ISender
4 | {
5 | public T Selection { get; } = selection;
6 |
7 | public object Sender { get; } = sender;
8 | }
9 |
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/AddUntitledIPConfigMessage.cs:
--------------------------------------------------------------------------------
1 | namespace IPConfig.Models.Messages;
2 |
3 | public class AddUntitledIPConfigMessage(object sender, string name = "") : ISender
4 | {
5 | public string Name { get; set; } = name;
6 |
7 | public object Sender { get; } = sender;
8 | }
9 |
--------------------------------------------------------------------------------
/IPConfig/Extensions/StringExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace IPConfig.Extensions;
4 |
5 | public static class StringExtensions
6 | {
7 | public static string Format(this string format, params object[] args)
8 | {
9 | return String.Format(format, args);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/IPConfig/Models/Messages/CollectionChangeActionMessage.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace IPConfig.Models.Messages;
4 |
5 | public class CollectionChangeActionMessage(object sender, CollectionChangeAction action, T item) : ISender
6 | {
7 | public CollectionChangeAction Action { get; } = action;
8 |
9 | public T Item { get; } = item;
10 |
11 | public object Sender { get; } = sender;
12 | }
13 |
--------------------------------------------------------------------------------
/IPConfig/Models/GitHub/GitHubApiException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace IPConfig.Models.GitHub;
4 |
5 | public class GitHubApiException : Exception
6 | {
7 | public GitHubApiException()
8 | { }
9 |
10 | public GitHubApiException(string? message) : base(message)
11 | { }
12 |
13 | public GitHubApiException(string? message, Exception? innerException) : base(message, innerException)
14 | { }
15 | }
16 |
--------------------------------------------------------------------------------
/IPConfig/Extensions/WindowsThemeExtensions.cs:
--------------------------------------------------------------------------------
1 | using HandyControl.Data;
2 |
3 | using static IPConfig.Helpers.ThemeWatcher;
4 |
5 | namespace IPConfig.Extensions;
6 |
7 | public static class WindowsThemeExtensions
8 | {
9 | public static SkinType ToSkinType(this WindowsTheme windowsTheme)
10 | {
11 | return windowsTheme switch {
12 | WindowsTheme.Dark => SkinType.Dark,
13 | _ => SkinType.Default
14 | };
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/IPConfig/Themes/MyDarkTheme.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
6 |
7 |
9 |
10 |
12 |
13 |
--------------------------------------------------------------------------------
/IPConfig/Extensions/IPConfigModelExtensions.cs:
--------------------------------------------------------------------------------
1 | using IPConfig.Models;
2 |
3 | namespace IPConfig.Extensions;
4 |
5 | public static class IPConfigModelExtensions
6 | {
7 | public static EditableIPConfigModel AsEditable(this IPConfigModel source, bool beginEdit = true)
8 | {
9 | var target = EditableIPConfigModel.Empty;
10 | source.DeepCloneTo(target);
11 |
12 | if (beginEdit)
13 | {
14 | target.BeginEdit();
15 | }
16 |
17 | return target;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/IPConfig/Languages/LangExtension.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Data;
2 |
3 | namespace IPConfig.Languages;
4 |
5 | ///
6 | /// localization-of-a-wpf-app-the-simple-approach
7 | ///
8 | public class LangExtension : Binding
9 | {
10 | public LangExtension(LangKey langKey) : base("[" + langKey + "]")
11 | {
12 | Mode = BindingMode.OneWay;
13 | Source = LangSource.Instance;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/IPConfig/Helpers/ResourceHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Windows;
4 |
5 | namespace IPConfig.Helpers;
6 |
7 | public static class ResourceHelper
8 | {
9 | public static Stream? GetResourceStream(string path)
10 | {
11 | try
12 | {
13 | var stream = Application.GetResourceStream(new(path, UriKind.RelativeOrAbsolute)).Stream;
14 |
15 | return stream;
16 | }
17 | catch (IOException)
18 | {
19 | return null;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/IPConfig/Helpers/FileOrderHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace IPConfig.Helpers;
4 |
5 | public static class FileOrderHelper
6 | {
7 | public static int GetOrder(IEnumerable orders, int start = 1)
8 | {
9 | HashSet uniqueOrders = new(orders);
10 |
11 | for (int i = start; i < uniqueOrders.Count + 1; i++)
12 | {
13 | if (!uniqueOrders.Contains(i))
14 | {
15 | return i;
16 | }
17 | }
18 |
19 | return uniqueOrders.Count + 1;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/IPConfig/Themes/MyLightTheme.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
6 |
7 |
9 |
10 |
12 |
13 |
--------------------------------------------------------------------------------
/IPConfig/Themes/MyVioletTheme.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
6 |
7 |
9 |
10 |
12 |
13 |
--------------------------------------------------------------------------------
/IPConfig/Converters/StringToIntConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 |
5 | namespace IPConfig.Converters;
6 |
7 | public class StringToIntConverter : IValueConverter
8 | {
9 | public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
10 | {
11 | return Int32.TryParse(value?.ToString(), out int v) ? v : value;
12 | }
13 |
14 | public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | return value?.ToString();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/IPConfig/Views/StatusBarView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | using IPConfig.ViewModels;
4 |
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 | namespace IPConfig.Views;
8 |
9 | ///
10 | /// StatusBarView.xaml 的交互逻辑
11 | ///
12 | public partial class StatusBarView : UserControl
13 | {
14 | public StatusBarView()
15 | {
16 | InitializeComponent();
17 |
18 | if (App.IsInDesignMode)
19 | {
20 | return;
21 | }
22 |
23 | DataContext = App.Current.Services.GetRequiredService();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/IPConfig/Views/NicInfoCardView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | using IPConfig.ViewModels;
4 |
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 | namespace IPConfig.Views;
8 |
9 | ///
10 | /// NicInfoCardView.xaml 的交互逻辑
11 | ///
12 | public partial class NicInfoCardView : UserControl
13 | {
14 | public NicInfoCardView()
15 | {
16 | InitializeComponent();
17 |
18 | if (App.IsInDesignMode)
19 | {
20 | return;
21 | }
22 |
23 | DataContext = App.Current.Services.GetRequiredService();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/IPConfig/Views/NicSelectorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | using IPConfig.ViewModels;
4 |
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 | namespace IPConfig.Views;
8 |
9 | ///
10 | /// NicSelectorView.xaml 的交互逻辑
11 | ///
12 | public partial class NicSelectorView : UserControl
13 | {
14 | public NicSelectorView()
15 | {
16 | InitializeComponent();
17 |
18 | if (App.IsInDesignMode)
19 | {
20 | return;
21 | }
22 |
23 | DataContext = App.Current.Services.GetRequiredService();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/IPConfig/Views/VersionInfoView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | using IPConfig.ViewModels;
4 |
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 | namespace IPConfig.Views;
8 |
9 | ///
10 | /// VersionInfoView.xaml 的交互逻辑
11 | ///
12 | public partial class VersionInfoView : UserControl
13 | {
14 | public VersionInfoView()
15 | {
16 | InitializeComponent();
17 |
18 | if (App.IsInDesignMode)
19 | {
20 | return;
21 | }
22 |
23 | DataContext = App.Current.Services.GetRequiredService();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/IPConfig/Views/NicSpeedMonitorView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | using IPConfig.ViewModels;
4 |
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 | namespace IPConfig.Views;
8 |
9 | ///
10 | /// NicSpeedMonitorView.xaml 的交互逻辑
11 | ///
12 | public partial class NicSpeedMonitorView : UserControl
13 | {
14 | public NicSpeedMonitorView()
15 | {
16 | InitializeComponent();
17 |
18 | if (App.IsInDesignMode)
19 | {
20 | return;
21 | }
22 |
23 | DataContext = App.Current.Services.GetRequiredService();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/IPConfig/Models/Validations/IPValidationAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | using IPConfig.Languages;
5 |
6 | namespace IPConfig.Models.Validations;
7 |
8 | public sealed class IPValidationAttribute : ValidationLangAttributeBase
9 | {
10 | public IPValidationAttribute(LangKey langKey) : base()
11 | {
12 | LangKey = langKey;
13 | }
14 |
15 | public override bool IsValid(object? value)
16 | {
17 | if (String.IsNullOrEmpty(value?.ToString()))
18 | {
19 | return true;
20 | }
21 |
22 | return IPAddress.TryParse(value?.ToString(), out _);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/IPConfig/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
11 |
--------------------------------------------------------------------------------
/IPConfig/Converters/CopyContentFormatConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 |
5 | using IPConfig.Languages;
6 |
7 | namespace IPConfig.Converters;
8 |
9 | public class CopyContentFormatConverter : IValueConverter
10 | {
11 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
12 | {
13 | return String.Format(LangSource.Instance[LangKey.CopyContent_Format_], value);
14 | }
15 |
16 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | throw new NotImplementedException();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/IPConfig/Views/IPConfigListSelectionCounterView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | using IPConfig.ViewModels;
4 |
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 | namespace IPConfig.Views;
8 |
9 | ///
10 | /// IPConfigListSelectionCounterView.xaml 的交互逻辑
11 | ///
12 | public partial class IPConfigListSelectionCounterView : UserControl
13 | {
14 | public IPConfigListSelectionCounterView()
15 | {
16 | InitializeComponent();
17 |
18 | if (App.IsInDesignMode)
19 | {
20 | return;
21 | }
22 |
23 | DataContext = App.Current.Services.GetRequiredService();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/IPConfig/Converters/MultiValueEqualsConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Windows.Data;
6 |
7 | namespace IPConfig.Converters;
8 |
9 | public class MultiValueEqualsConverter : IMultiValueConverter
10 | {
11 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
12 | {
13 | return values.Skip(1).All(x => EqualityComparer