增加开机自启功能和自启设置
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using NLog;
|
using Microsoft.Win32;
|
||||||
|
using NLog;
|
||||||
using SpineViewer.Natives;
|
using SpineViewer.Natives;
|
||||||
using SpineViewer.Views;
|
using SpineViewer.Views;
|
||||||
using System.Collections.Frozen;
|
using System.Collections.Frozen;
|
||||||
@@ -18,15 +19,28 @@ namespace SpineViewer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
|
public const string AppName = "SpineViewer_D";
|
||||||
|
public const string ProgId = "SpineViewer_D.skel";
|
||||||
|
#else
|
||||||
|
public const string AppName = "SpineViewer";
|
||||||
public const string ProgId = "SpineViewer.skel";
|
public const string ProgId = "SpineViewer.skel";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public const string AutoRunFlag = "--autorun";
|
||||||
|
private const string MutexName = "__SpineViewerInstance__";
|
||||||
|
private const string PipeName = "__SpineViewerPipe__";
|
||||||
|
|
||||||
public static readonly string ProcessPath = Environment.ProcessPath;
|
public static readonly string ProcessPath = Environment.ProcessPath;
|
||||||
public static readonly string ProcessDirectory = Path.GetDirectoryName(Environment.ProcessPath);
|
public static readonly string ProcessDirectory = Path.GetDirectoryName(Environment.ProcessPath);
|
||||||
public static readonly string ProcessName = Process.GetCurrentProcess().ProcessName;
|
public static readonly string ProcessName = Process.GetCurrentProcess().ProcessName;
|
||||||
public static readonly string Version = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
|
public static readonly string Version = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
|
||||||
|
|
||||||
private const string MutexName = "SpineViewerInstance";
|
private static readonly string AutoRunCommand = $"\"{ProcessPath}\" {AutoRunFlag}";
|
||||||
private const string PipeName = "SpineViewerPipe";
|
|
||||||
|
private static readonly string SkelFileDescription = $"SpineViewer File";
|
||||||
|
private static readonly string SkelIconFilePath = Path.Combine(ProcessDirectory, "Resources\\Images\\skel.ico");
|
||||||
|
private static readonly string ShellOpenCommand = $"\"{ProcessPath}\" \"%1\"";
|
||||||
|
|
||||||
private static readonly Logger _logger;
|
private static readonly Logger _logger;
|
||||||
private static readonly Mutex _instanceMutex;
|
private static readonly Mutex _instanceMutex;
|
||||||
@@ -87,7 +101,7 @@ namespace SpineViewer
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 2. 遍历同名进程
|
// 遍历同名进程
|
||||||
var processes = Process.GetProcessesByName(ProcessName);
|
var processes = Process.GetProcessesByName(ProcessName);
|
||||||
foreach (var p in processes)
|
foreach (var p in processes)
|
||||||
{
|
{
|
||||||
@@ -199,6 +213,116 @@ namespace SpineViewer
|
|||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool AutoRun
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"))
|
||||||
|
{
|
||||||
|
var command = key?.GetValue(AppName) as string;
|
||||||
|
return string.Equals(command, AutoRunCommand, StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Error("Failed to query autorun registry key, {0}", ex.Message);
|
||||||
|
_logger.Trace(ex.ToString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
// 写入自启命令
|
||||||
|
using (var key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"))
|
||||||
|
{
|
||||||
|
key?.SetValue(AppName, AutoRunCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 删除自启命令
|
||||||
|
using (var key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"))
|
||||||
|
{
|
||||||
|
key?.DeleteValue(AppName, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Error("Failed to set autorun registry key, {0}", ex.Message);
|
||||||
|
_logger.Trace(ex.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool AssociateFileSuffix
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 检查 .skel 的 ProgID
|
||||||
|
using (var key = Registry.CurrentUser.OpenSubKey(@"Software\Classes\.skel"))
|
||||||
|
{
|
||||||
|
var progIdValue = key?.GetValue("") as string;
|
||||||
|
if (!string.Equals(progIdValue, App.ProgId, StringComparison.OrdinalIgnoreCase))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查 command 指令是否相同
|
||||||
|
using (var key = Registry.CurrentUser.OpenSubKey($@"Software\Classes\{App.ProgId}\shell\open\command"))
|
||||||
|
{
|
||||||
|
var command = key?.GetValue("") as string;
|
||||||
|
if (string.IsNullOrWhiteSpace(command))
|
||||||
|
return false;
|
||||||
|
return command == ShellOpenCommand;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
// 文件关联
|
||||||
|
using (var key = Registry.CurrentUser.CreateSubKey(@"Software\Classes\.skel"))
|
||||||
|
{
|
||||||
|
key?.SetValue("", App.ProgId);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var key = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{App.ProgId}"))
|
||||||
|
{
|
||||||
|
key?.SetValue("", SkelFileDescription);
|
||||||
|
using (var iconKey = key?.CreateSubKey("DefaultIcon"))
|
||||||
|
{
|
||||||
|
iconKey?.SetValue("", $"\"{SkelIconFilePath}\"");
|
||||||
|
}
|
||||||
|
using (var shellKey = key?.CreateSubKey(@"shell\open\command"))
|
||||||
|
{
|
||||||
|
shellKey?.SetValue("", ShellOpenCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 删除关联
|
||||||
|
Registry.CurrentUser.DeleteSubKeyTree(@"Software\Classes\.skel", false);
|
||||||
|
Registry.CurrentUser.DeleteSubKeyTree($@"Software\Classes\{App.ProgId}", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Shell32.NotifyAssociationChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 程序语言
|
/// 程序语言
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -221,7 +345,6 @@ namespace SpineViewer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private AppLanguage _language = AppLanguage.ZH;
|
private AppLanguage _language = AppLanguage.ZH;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum AppLanguage
|
public enum AppLanguage
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using Spine.SpineWrappers;
|
using Spine.SpineWrappers;
|
||||||
|
using SpineViewer.Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -73,6 +75,12 @@ namespace SpineViewer.Models
|
|||||||
|
|
||||||
#region 程序选项
|
#region 程序选项
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private bool _autoRun;
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private string _autoRunWorkspaceConfigPath;
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool _wallpaperView;
|
private bool _wallpaperView;
|
||||||
|
|
||||||
@@ -85,6 +93,14 @@ namespace SpineViewer.Models
|
|||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private AppLanguage _appLanguage;
|
private AppLanguage _appLanguage;
|
||||||
|
|
||||||
|
public RelayCommand Cmd_SelectAutoRunWorkspaceConfigPath => _cmd_SelectAutoRunWorkspaceConfigPath ??= new(() =>
|
||||||
|
{
|
||||||
|
if (!DialogService.ShowOpenJsonDialog(out var fileName))
|
||||||
|
return;
|
||||||
|
AutoRunWorkspaceConfigPath = fileName;
|
||||||
|
});
|
||||||
|
private RelayCommand? _cmd_SelectAutoRunWorkspaceConfigPath;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
<s:String x:Key="Str_PreferenceWithDots">Preferences...</s:String>
|
<s:String x:Key="Str_PreferenceWithDots">Preferences...</s:String>
|
||||||
<s:String x:Key="Str_Exit">Exit</s:String>
|
<s:String x:Key="Str_Exit">Exit</s:String>
|
||||||
|
|
||||||
|
<!-- 首选项 -->
|
||||||
|
<s:String x:Key="Str_AutoRun_Short">Auto Start</s:String>
|
||||||
|
<s:String x:Key="Str_AutoRunWorkspaceConfigPath">Auto-load Workspace File on Startup</s:String>
|
||||||
|
<s:String x:Key="Str_AutoRunWorkspaceConfigPathTooltip">Specifies the workspace configuration file to be automatically loaded when the program starts with Windows startup. This takes effect only if auto-startup is enabled.</s:String>
|
||||||
|
|
||||||
<!-- 标签页 -->
|
<!-- 标签页 -->
|
||||||
<s:String x:Key="Str_Explorer">Explorer</s:String>
|
<s:String x:Key="Str_Explorer">Explorer</s:String>
|
||||||
<s:String x:Key="Str_SpineObject">Model</s:String>
|
<s:String x:Key="Str_SpineObject">Model</s:String>
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
<s:String x:Key="Str_PreferenceWithDots">設定...</s:String>
|
<s:String x:Key="Str_PreferenceWithDots">設定...</s:String>
|
||||||
<s:String x:Key="Str_Exit">終了</s:String>
|
<s:String x:Key="Str_Exit">終了</s:String>
|
||||||
|
|
||||||
|
<!-- 首选项 -->
|
||||||
|
<s:String x:Key="Str_AutoRun_Short" xml:lang="ja">自動起動</s:String>
|
||||||
|
<s:String x:Key="Str_AutoRunWorkspaceConfigPath">起動時にワークスペースファイルを自動読み込み</s:String>
|
||||||
|
<s:String x:Key="Str_AutoRunWorkspaceConfigPathTooltip">プログラムが Windows 起動と同時に自動起動した場合に、自動的に読み込むワークスペース設定ファイルを指定します。自動起動が有効な場合にのみ適用されます。</s:String>
|
||||||
|
|
||||||
<!-- 标签页 -->
|
<!-- 标签页 -->
|
||||||
<s:String x:Key="Str_Explorer">エクスプローラー</s:String>
|
<s:String x:Key="Str_Explorer">エクスプローラー</s:String>
|
||||||
<s:String x:Key="Str_SpineObject">モデル</s:String>
|
<s:String x:Key="Str_SpineObject">モデル</s:String>
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
<s:String x:Key="Str_PreferenceWithDots">首选项...</s:String>
|
<s:String x:Key="Str_PreferenceWithDots">首选项...</s:String>
|
||||||
<s:String x:Key="Str_Exit">退出</s:String>
|
<s:String x:Key="Str_Exit">退出</s:String>
|
||||||
|
|
||||||
|
<!-- 首选项 -->
|
||||||
|
<s:String x:Key="Str_AutoRun">开机自启</s:String>
|
||||||
|
<s:String x:Key="Str_AutoRunWorkspaceConfigPath">自启动加载工作区文件</s:String>
|
||||||
|
<s:String x:Key="Str_AutoRunWorkspaceConfigPathTooltip">设置程序开机自启后自动加载的工作区配置文件,仅在启用开机自启时生效</s:String>
|
||||||
|
|
||||||
<!-- 标签页 -->
|
<!-- 标签页 -->
|
||||||
<s:String x:Key="Str_Explorer">浏览</s:String>
|
<s:String x:Key="Str_Explorer">浏览</s:String>
|
||||||
<s:String x:Key="Str_SpineObject">模型</s:String>
|
<s:String x:Key="Str_SpineObject">模型</s:String>
|
||||||
|
|||||||
@@ -29,6 +29,13 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
|
|
||||||
public string Title => $"SpineViewer - v{App.Version}";
|
public string Title => $"SpineViewer - v{App.Version}";
|
||||||
|
|
||||||
|
public string AutoRunWorkspaceConfigPath
|
||||||
|
{
|
||||||
|
get => _autoRunWorkspaceConfigPath;
|
||||||
|
set => SetProperty(ref _autoRunWorkspaceConfigPath, value);
|
||||||
|
}
|
||||||
|
private string _autoRunWorkspaceConfigPath;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// SFML 渲染对象
|
/// SFML 渲染对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -26,10 +26,6 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string PreferenceFilePath = Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), "preference.json");
|
public static readonly string PreferenceFilePath = Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), "preference.json");
|
||||||
|
|
||||||
private static readonly string SkelFileDescription = "SpineViewer File";
|
|
||||||
private static readonly string SkelIconFilePath = Path.Combine(App.ProcessDirectory, "Resources\\Images\\skel.ico");
|
|
||||||
private static readonly string ShellOpenCommand = $"\"{App.ProcessPath}\" \"%1\"";
|
|
||||||
|
|
||||||
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
private readonly MainWindowViewModel _vmMain;
|
private readonly MainWindowViewModel _vmMain;
|
||||||
@@ -111,6 +107,8 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
DebugPoints = DebugPoints,
|
DebugPoints = DebugPoints,
|
||||||
DebugClippings = DebugClippings,
|
DebugClippings = DebugClippings,
|
||||||
|
|
||||||
|
AutoRun = AutoRun,
|
||||||
|
AutoRunWorkspaceConfigPath = AutoRunWorkspaceConfigPath,
|
||||||
WallpaperView = WallpaperView,
|
WallpaperView = WallpaperView,
|
||||||
RenderSelectedOnly = RenderSelectedOnly,
|
RenderSelectedOnly = RenderSelectedOnly,
|
||||||
AssociateFileSuffix = AssociateFileSuffix,
|
AssociateFileSuffix = AssociateFileSuffix,
|
||||||
@@ -137,6 +135,8 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
DebugPoints = value.DebugPoints;
|
DebugPoints = value.DebugPoints;
|
||||||
DebugClippings = value.DebugClippings;
|
DebugClippings = value.DebugClippings;
|
||||||
|
|
||||||
|
AutoRun = value.AutoRun;
|
||||||
|
AutoRunWorkspaceConfigPath = value.AutoRunWorkspaceConfigPath;
|
||||||
WallpaperView = value.WallpaperView;
|
WallpaperView = value.WallpaperView;
|
||||||
RenderSelectedOnly = value.RenderSelectedOnly;
|
RenderSelectedOnly = value.RenderSelectedOnly;
|
||||||
AssociateFileSuffix = value.AssociateFileSuffix;
|
AssociateFileSuffix = value.AssociateFileSuffix;
|
||||||
@@ -248,16 +248,21 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
|
|
||||||
public bool AutoRun
|
public bool AutoRun
|
||||||
{
|
{
|
||||||
get => throw new NotImplementedException();
|
get => ((App)App.Current).AutoRun;
|
||||||
set => throw new NotImplementedException();
|
set => SetProperty(((App)App.Current).AutoRun, value, v => ((App)App.Current).AutoRun = v);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string AutoRunWorkspaceConfigPath
|
||||||
|
{
|
||||||
|
get => _vmMain.AutoRunWorkspaceConfigPath;
|
||||||
|
set => SetProperty(_vmMain.AutoRunWorkspaceConfigPath, value, v => _vmMain.AutoRunWorkspaceConfigPath = v);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool WallpaperView
|
public bool WallpaperView
|
||||||
{
|
{
|
||||||
get => _wallpaperView;
|
get => _vmMain.SFMLRendererViewModel.WallpaperView;
|
||||||
set => SetProperty(ref _wallpaperView, value);
|
set => SetProperty(_vmMain.SFMLRendererViewModel.WallpaperView, value, v => _vmMain.SFMLRendererViewModel.WallpaperView = v);
|
||||||
}
|
}
|
||||||
private bool _wallpaperView; // UI 变化通过 PropertyChanged 事件交由 View 层处理
|
|
||||||
|
|
||||||
public bool RenderSelectedOnly
|
public bool RenderSelectedOnly
|
||||||
{
|
{
|
||||||
@@ -267,67 +272,8 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
|
|
||||||
public bool AssociateFileSuffix
|
public bool AssociateFileSuffix
|
||||||
{
|
{
|
||||||
get
|
get => ((App)App.Current).AssociateFileSuffix;
|
||||||
{
|
set => SetProperty(((App)App.Current).AssociateFileSuffix, value, v => ((App)App.Current).AssociateFileSuffix = v);
|
||||||
try
|
|
||||||
{
|
|
||||||
// 检查 .skel 的 ProgID
|
|
||||||
using (var key = Registry.CurrentUser.OpenSubKey(@"Software\Classes\.skel"))
|
|
||||||
{
|
|
||||||
var progIdValue = key?.GetValue("") as string;
|
|
||||||
if (!string.Equals(progIdValue, App.ProgId, StringComparison.OrdinalIgnoreCase))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查 command 指令是否相同
|
|
||||||
using (var key = Registry.CurrentUser.OpenSubKey($@"Software\Classes\{App.ProgId}\shell\open\command"))
|
|
||||||
{
|
|
||||||
var command = key?.GetValue("") as string;
|
|
||||||
if (string.IsNullOrWhiteSpace(command))
|
|
||||||
return false;
|
|
||||||
return command == ShellOpenCommand;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetProperty(AssociateFileSuffix, value, v =>
|
|
||||||
{
|
|
||||||
if (v)
|
|
||||||
{
|
|
||||||
// 文件关联
|
|
||||||
using (var key = Registry.CurrentUser.CreateSubKey(@"Software\Classes\.skel"))
|
|
||||||
{
|
|
||||||
key?.SetValue("", App.ProgId);
|
|
||||||
}
|
|
||||||
|
|
||||||
using (var key = Registry.CurrentUser.CreateSubKey($@"Software\Classes\{App.ProgId}"))
|
|
||||||
{
|
|
||||||
key?.SetValue("", SkelFileDescription);
|
|
||||||
using (var iconKey = key?.CreateSubKey("DefaultIcon"))
|
|
||||||
{
|
|
||||||
iconKey?.SetValue("", $"\"{SkelIconFilePath}\"");
|
|
||||||
}
|
|
||||||
using (var shellKey = key?.CreateSubKey(@"shell\open\command"))
|
|
||||||
{
|
|
||||||
shellKey?.SetValue("", ShellOpenCommand);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 删除关联
|
|
||||||
Registry.CurrentUser.DeleteSubKeyTree(@"Software\Classes\.skel", false);
|
|
||||||
Registry.CurrentUser.DeleteSubKeyTree($@"Software\Classes\{App.ProgId}", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
Shell32.NotifyAssociationChanged();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AppLanguage AppLanguage
|
public AppLanguage AppLanguage
|
||||||
|
|||||||
@@ -240,6 +240,13 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
}
|
}
|
||||||
private Stretch _backgroundImageMode = Stretch.Uniform;
|
private Stretch _backgroundImageMode = Stretch.Uniform;
|
||||||
|
|
||||||
|
public bool WallpaperView
|
||||||
|
{
|
||||||
|
get => _wallpaperView;
|
||||||
|
set => SetProperty(ref _wallpaperView, value);
|
||||||
|
}
|
||||||
|
private bool _wallpaperView;
|
||||||
|
|
||||||
public bool RenderSelectedOnly
|
public bool RenderSelectedOnly
|
||||||
{
|
{
|
||||||
get => _renderSelectedOnly;
|
get => _renderSelectedOnly;
|
||||||
@@ -465,10 +472,13 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
}
|
}
|
||||||
|
|
||||||
using var v = _renderer.GetView();
|
using var v = _renderer.GetView();
|
||||||
_wallpaperRenderer.SetView(v);
|
|
||||||
|
|
||||||
_renderer.Clear(_backgroundColor);
|
_renderer.Clear(_backgroundColor);
|
||||||
_wallpaperRenderer.Clear(_backgroundColor);
|
|
||||||
|
if (_wallpaperView)
|
||||||
|
{
|
||||||
|
_wallpaperRenderer.SetView(v);
|
||||||
|
_wallpaperRenderer.Clear(_backgroundColor);
|
||||||
|
}
|
||||||
|
|
||||||
// 渲染背景
|
// 渲染背景
|
||||||
lock (_bgLock)
|
lock (_bgLock)
|
||||||
@@ -499,7 +509,11 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
bg.Position = view.Center;
|
bg.Position = view.Center;
|
||||||
bg.Rotation = view.Rotation;
|
bg.Rotation = view.Rotation;
|
||||||
_renderer.Draw(bg);
|
_renderer.Draw(bg);
|
||||||
_wallpaperRenderer.Draw(bg);
|
|
||||||
|
if (_wallpaperView)
|
||||||
|
{
|
||||||
|
_wallpaperRenderer.Draw(bg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,12 +553,20 @@ namespace SpineViewer.ViewModels.MainWindow
|
|||||||
sp.EnableDebug = true;
|
sp.EnableDebug = true;
|
||||||
_renderer.Draw(sp);
|
_renderer.Draw(sp);
|
||||||
sp.EnableDebug = false;
|
sp.EnableDebug = false;
|
||||||
_wallpaperRenderer.Draw(sp);
|
|
||||||
|
if (_wallpaperView)
|
||||||
|
{
|
||||||
|
_wallpaperRenderer.Draw(sp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderer.Display();
|
_renderer.Display();
|
||||||
_wallpaperRenderer.Display();
|
|
||||||
|
if (_wallpaperView)
|
||||||
|
{
|
||||||
|
_wallpaperRenderer.Display();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
_vm.SpineObjectListViewModel.RequestSelectionChanging += SpinesListView_RequestSelectionChanging;
|
_vm.SpineObjectListViewModel.RequestSelectionChanging += SpinesListView_RequestSelectionChanging;
|
||||||
_vm.SFMLRendererViewModel.RequestSelectionChanging += SpinesListView_RequestSelectionChanging;
|
_vm.SFMLRendererViewModel.RequestSelectionChanging += SpinesListView_RequestSelectionChanging;
|
||||||
_vm.PreferenceViewModel.PropertyChanged += PreferenceViewModel_PropertyChanged;
|
_vm.SFMLRendererViewModel.PropertyChanged += SFMLRendererViewModel_PropertyChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -193,11 +193,26 @@ public partial class MainWindow : Window
|
|||||||
private void MainWindow_ContentRendered(object? sender, EventArgs e)
|
private void MainWindow_ContentRendered(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string[] args = Environment.GetCommandLineArgs();
|
string[] args = Environment.GetCommandLineArgs();
|
||||||
if (args.Length > 1)
|
|
||||||
|
// 不带参数启动
|
||||||
|
if (args.Length <= 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 带一个参数启动, 允许提供一些启动选项
|
||||||
|
if (args.Length == 2)
|
||||||
{
|
{
|
||||||
string[] filePaths = args.Skip(1).ToArray();
|
if (args[1] == App.AutoRunFlag)
|
||||||
_vm.SpineObjectListViewModel.AddSpineObjectFromFileList(filePaths);
|
{
|
||||||
|
var autoPath = _vm.AutoRunWorkspaceConfigPath;
|
||||||
|
if (!string.IsNullOrWhiteSpace(autoPath) && JsonHelper.Deserialize<WorkspaceModel>(autoPath, out var obj))
|
||||||
|
_vm.Workspace = obj;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 其余提供了任意参数的情况
|
||||||
|
string[] filePaths = args.Skip(1).ToArray();
|
||||||
|
_vm.SpineObjectListViewModel.AddSpineObjectFromFileList(filePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainWindow_Closed(object? sender, EventArgs e)
|
private void MainWindow_Closed(object? sender, EventArgs e)
|
||||||
@@ -210,9 +225,9 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PreferenceViewModel 事件处理
|
#region SFMLRendererViewModel 事件处理
|
||||||
|
|
||||||
private void PreferenceViewModel_PropertyChanged(object? sender, PropertyChangedEventArgs e)
|
private void SFMLRendererViewModel_PropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.PropertyName == nameof(PreferenceViewModel.WallpaperView))
|
if (e.PropertyName == nameof(PreferenceViewModel.WallpaperView))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,115 +53,219 @@
|
|||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<StackPanel Grid.IsSharedSizeScope="True">
|
<StackPanel Grid.IsSharedSizeScope="True">
|
||||||
<GroupBox Header="{DynamicResource Str_TextureLoadPreference}">
|
<GroupBox Header="{DynamicResource Str_TextureLoadPreference}">
|
||||||
<Grid>
|
<StackPanel>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid>
|
||||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Col1"/>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*" />
|
||||||
<Grid.RowDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<Label Content="{DynamicResource Str_ForcePremul}" ToolTip="{DynamicResource Str_ForcePremulTooltip}"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<ToggleButton Grid.Column="1" IsChecked="{Binding ForcePremul}" ToolTip="{DynamicResource Str_ForcePremulTooltip}"/>
|
||||||
<RowDefinition Height="Auto"/>
|
</Grid>
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_ForcePremul}" ToolTip="{DynamicResource Str_ForcePremulTooltip}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="0" Grid.Column="1" IsChecked="{Binding ForcePremul}" ToolTip="{DynamicResource Str_ForcePremulTooltip}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_ForceNearest}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding ForceNearest}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_ForceNearest}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="1" Grid.Column="1" IsChecked="{Binding ForceNearest}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
<Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource Str_ForceMipmap}" ToolTip="{DynamicResource Str_ForceMipmapTooltip}"/>
|
<ColumnDefinition Width="*" />
|
||||||
<ToggleButton Grid.Row="2" Grid.Column="1" IsChecked="{Binding ForceMipmap}" ToolTip="{DynamicResource Str_ForceMipmapTooltip}"/>
|
</Grid.ColumnDefinitions>
|
||||||
</Grid>
|
<Label Content="{DynamicResource Str_ForceMipmap}" ToolTip="{DynamicResource Str_ForceMipmapTooltip}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding ForceMipmap}" ToolTip="{DynamicResource Str_ForceMipmapTooltip}"/>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="{DynamicResource Str_SpineLoadPreference}">
|
<GroupBox Header="{DynamicResource Str_SpineLoadPreference}">
|
||||||
<Grid>
|
<StackPanel>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid>
|
||||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Col1"/>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*" />
|
||||||
<Grid.RowDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<Label Content="{DynamicResource Str_IsShown}"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<ToggleButton Grid.Column="1" IsChecked="{Binding IsShown}"/>
|
||||||
<RowDefinition Height="Auto"/>
|
</Grid>
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_IsShown}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="0" Grid.Column="1" IsChecked="{Binding IsShown}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_UsePma}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding UsePma}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_UsePma}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="1" Grid.Column="1" IsChecked="{Binding UsePma}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugTexture}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugTexture}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource Str_DebugTexture}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="2" Grid.Column="1" IsChecked="{Binding DebugTexture}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugBounds}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugBounds}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="3" Grid.Column="0" Content="{DynamicResource Str_DebugBounds}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="3" Grid.Column="1" IsChecked="{Binding DebugBounds}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugBones}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugBones}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="4" Grid.Column="0" Content="{DynamicResource Str_DebugBones}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="4" Grid.Column="1" IsChecked="{Binding DebugBones}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugRegions}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugRegions}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="5" Grid.Column="0" Content="{DynamicResource Str_DebugRegions}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="5" Grid.Column="1" IsChecked="{Binding DebugRegions}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugMeshHulls}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugMeshHulls}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="6" Grid.Column="0" Content="{DynamicResource Str_DebugMeshHulls}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="6" Grid.Column="1" IsChecked="{Binding DebugMeshHulls}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugMeshes}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugMeshes}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="7" Grid.Column="0" Content="{DynamicResource Str_DebugMeshes}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="7" Grid.Column="1" IsChecked="{Binding DebugMeshes}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugClippings}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugClippings}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="8" Grid.Column="0" Content="{DynamicResource Str_DebugClippings}"/>
|
<!-- <Grid>
|
||||||
<ToggleButton Grid.Row="8" Grid.Column="1" IsChecked="{Binding DebugClippings}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugBoundingBoxes}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugBoundingBoxes}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<!--<Label Grid.Row="9" Grid.Column="0" Content="{DynamicResource Str_DebugBoundingBoxes}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="9" Grid.Column="1" IsChecked="{Binding DebugBoundingBoxes}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugPaths}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugPaths}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="10" Grid.Column="0" Content="{DynamicResource Str_DebugPaths}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="10" Grid.Column="1" IsChecked="{Binding DebugPaths}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_DebugPoints}"/>
|
||||||
|
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugPoints}"/>
|
||||||
|
</Grid> -->
|
||||||
|
|
||||||
<Label Grid.Row="11" Grid.Column="0" Content="{DynamicResource Str_DebugPoints}"/>
|
</StackPanel>
|
||||||
<ToggleButton Grid.Row="11" Grid.Column="1" IsChecked="{Binding DebugPoints}"/>-->
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="{DynamicResource Str_AppPreference}">
|
<GroupBox Header="{DynamicResource Str_AppPreference}">
|
||||||
<Grid>
|
<StackPanel>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid>
|
||||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Col1"/>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*" />
|
||||||
<Grid.RowDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<Label Content="{DynamicResource Str_AutoRun}"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<ToggleButton Grid.Column="1"
|
||||||
<RowDefinition Height="Auto"/>
|
IsChecked="{Binding AutoRun}"/>
|
||||||
<RowDefinition Height="Auto"/>
|
</Grid>
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_WallpaperView}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="0" Grid.Column="1" IsChecked="{Binding WallpaperView}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_AutoRunWorkspaceConfigPath}"
|
||||||
|
ToolTip="{DynamicResource Str_AutoRunWorkspaceConfigPathTooltip}"/>
|
||||||
|
<DockPanel Grid.Column="1">
|
||||||
|
<Button DockPanel.Dock="Right"
|
||||||
|
Content="..."
|
||||||
|
Command="{Binding Cmd_SelectAutoRunWorkspaceConfigPath}"/>
|
||||||
|
<TextBox Grid.Column="1"
|
||||||
|
Text="{Binding AutoRunWorkspaceConfigPath}"
|
||||||
|
ToolTip="{DynamicResource Str_AutoRunWorkspaceConfigPathTooltip}"/>
|
||||||
|
</DockPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_RenderSelectedOnly}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="1" Grid.Column="1" IsChecked="{Binding RenderSelectedOnly}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_WallpaperView}"/>
|
||||||
|
<ToggleButton Grid.Column="1"
|
||||||
|
IsChecked="{Binding WallpaperView}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource Str_AssociateFileSuffix}"/>
|
<Grid>
|
||||||
<ToggleButton Grid.Row="2" Grid.Column="1" IsChecked="{Binding AssociateFileSuffix}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_RenderSelectedOnly}"/>
|
||||||
|
<ToggleButton Grid.Column="1"
|
||||||
|
IsChecked="{Binding RenderSelectedOnly}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Label Grid.Row="3" Grid.Column="0" Content="{DynamicResource Str_Language}"/>
|
<Grid>
|
||||||
<ComboBox Grid.Row="3" Grid.Column="1"
|
<Grid.ColumnDefinitions>
|
||||||
SelectedItem="{Binding AppLanguage}"
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
ItemsSource="{x:Static vm:PreferenceViewModel.AppLanguageOptions}"/>
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_AssociateFileSuffix}"/>
|
||||||
|
<ToggleButton Grid.Column="1"
|
||||||
|
IsChecked="{Binding AssociateFileSuffix}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Content="{DynamicResource Str_Language}"/>
|
||||||
|
<ComboBox Grid.Column="1"
|
||||||
|
SelectedItem="{Binding AppLanguage}"
|
||||||
|
ItemsSource="{x:Static vm:PreferenceViewModel.AppLanguageOptions}"/>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
Reference in New Issue
Block a user