增加开机自启功能和自启设置

This commit is contained in:
ww-rm
2025-09-29 23:26:06 +08:00
parent 6900968555
commit bd9f8d714a
10 changed files with 421 additions and 173 deletions

View File

@@ -1,4 +1,5 @@
using NLog;
using Microsoft.Win32;
using NLog;
using SpineViewer.Natives;
using SpineViewer.Views;
using System.Collections.Frozen;
@@ -18,15 +19,28 @@ namespace SpineViewer
/// </summary>
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";
#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 ProcessDirectory = Path.GetDirectoryName(Environment.ProcessPath);
public static readonly string ProcessName = Process.GetCurrentProcess().ProcessName;
public static readonly string Version = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
private const string MutexName = "SpineViewerInstance";
private const string PipeName = "SpineViewerPipe";
private static readonly string AutoRunCommand = $"\"{ProcessPath}\" {AutoRunFlag}";
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 Mutex _instanceMutex;
@@ -87,7 +101,7 @@ namespace SpineViewer
{
try
{
// 2. 遍历同名进程
// 遍历同名进程
var processes = Process.GetProcessesByName(ProcessName);
foreach (var p in processes)
{
@@ -199,6 +213,116 @@ namespace SpineViewer
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>
@@ -221,7 +345,6 @@ namespace SpineViewer
}
}
private AppLanguage _language = AppLanguage.ZH;
}
public enum AppLanguage

View File

@@ -1,5 +1,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Spine.SpineWrappers;
using SpineViewer.Services;
using System;
using System.Collections.Generic;
using System.IO;
@@ -73,6 +75,12 @@ namespace SpineViewer.Models
#region
[ObservableProperty]
private bool _autoRun;
[ObservableProperty]
private string _autoRunWorkspaceConfigPath;
[ObservableProperty]
private bool _wallpaperView;
@@ -85,6 +93,14 @@ namespace SpineViewer.Models
[ObservableProperty]
private AppLanguage _appLanguage;
public RelayCommand Cmd_SelectAutoRunWorkspaceConfigPath => _cmd_SelectAutoRunWorkspaceConfigPath ??= new(() =>
{
if (!DialogService.ShowOpenJsonDialog(out var fileName))
return;
AutoRunWorkspaceConfigPath = fileName;
});
private RelayCommand? _cmd_SelectAutoRunWorkspaceConfigPath;
#endregion
}
}

View File

@@ -17,6 +17,11 @@
<s:String x:Key="Str_PreferenceWithDots">Preferences...</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_SpineObject">Model</s:String>

View File

@@ -17,6 +17,11 @@
<s:String x:Key="Str_PreferenceWithDots">設定...</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_SpineObject">モデル</s:String>

View File

@@ -17,6 +17,11 @@
<s:String x:Key="Str_PreferenceWithDots">首选项...</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_SpineObject">模型</s:String>

View File

@@ -29,6 +29,13 @@ namespace SpineViewer.ViewModels.MainWindow
public string Title => $"SpineViewer - v{App.Version}";
public string AutoRunWorkspaceConfigPath
{
get => _autoRunWorkspaceConfigPath;
set => SetProperty(ref _autoRunWorkspaceConfigPath, value);
}
private string _autoRunWorkspaceConfigPath;
/// <summary>
/// SFML 渲染对象
/// </summary>

View File

@@ -26,10 +26,6 @@ namespace SpineViewer.ViewModels.MainWindow
/// </summary>
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 readonly MainWindowViewModel _vmMain;
@@ -111,6 +107,8 @@ namespace SpineViewer.ViewModels.MainWindow
DebugPoints = DebugPoints,
DebugClippings = DebugClippings,
AutoRun = AutoRun,
AutoRunWorkspaceConfigPath = AutoRunWorkspaceConfigPath,
WallpaperView = WallpaperView,
RenderSelectedOnly = RenderSelectedOnly,
AssociateFileSuffix = AssociateFileSuffix,
@@ -137,6 +135,8 @@ namespace SpineViewer.ViewModels.MainWindow
DebugPoints = value.DebugPoints;
DebugClippings = value.DebugClippings;
AutoRun = value.AutoRun;
AutoRunWorkspaceConfigPath = value.AutoRunWorkspaceConfigPath;
WallpaperView = value.WallpaperView;
RenderSelectedOnly = value.RenderSelectedOnly;
AssociateFileSuffix = value.AssociateFileSuffix;
@@ -248,16 +248,21 @@ namespace SpineViewer.ViewModels.MainWindow
public bool AutoRun
{
get => throw new NotImplementedException();
set => throw new NotImplementedException();
get => ((App)App.Current).AutoRun;
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
{
get => _wallpaperView;
set => SetProperty(ref _wallpaperView, value);
get => _vmMain.SFMLRendererViewModel.WallpaperView;
set => SetProperty(_vmMain.SFMLRendererViewModel.WallpaperView, value, v => _vmMain.SFMLRendererViewModel.WallpaperView = v);
}
private bool _wallpaperView; // UI 变化通过 PropertyChanged 事件交由 View 层处理
public bool RenderSelectedOnly
{
@@ -267,67 +272,8 @@ namespace SpineViewer.ViewModels.MainWindow
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
{
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();
});
}
get => ((App)App.Current).AssociateFileSuffix;
set => SetProperty(((App)App.Current).AssociateFileSuffix, value, v => ((App)App.Current).AssociateFileSuffix = v);
}
public AppLanguage AppLanguage

View File

@@ -240,6 +240,13 @@ namespace SpineViewer.ViewModels.MainWindow
}
private Stretch _backgroundImageMode = Stretch.Uniform;
public bool WallpaperView
{
get => _wallpaperView;
set => SetProperty(ref _wallpaperView, value);
}
private bool _wallpaperView;
public bool RenderSelectedOnly
{
get => _renderSelectedOnly;
@@ -465,10 +472,13 @@ namespace SpineViewer.ViewModels.MainWindow
}
using var v = _renderer.GetView();
_wallpaperRenderer.SetView(v);
_renderer.Clear(_backgroundColor);
if (_wallpaperView)
{
_wallpaperRenderer.SetView(v);
_wallpaperRenderer.Clear(_backgroundColor);
}
// 渲染背景
lock (_bgLock)
@@ -499,9 +509,13 @@ namespace SpineViewer.ViewModels.MainWindow
bg.Position = view.Center;
bg.Rotation = view.Rotation;
_renderer.Draw(bg);
if (_wallpaperView)
{
_wallpaperRenderer.Draw(bg);
}
}
}
if (_showAxis)
{
@@ -539,14 +553,22 @@ namespace SpineViewer.ViewModels.MainWindow
sp.EnableDebug = true;
_renderer.Draw(sp);
sp.EnableDebug = false;
if (_wallpaperView)
{
_wallpaperRenderer.Draw(sp);
}
}
}
_renderer.Display();
if (_wallpaperView)
{
_wallpaperRenderer.Display();
}
}
}
catch (Exception ex)
{
_logger.Trace(ex.ToString());

View File

@@ -69,7 +69,7 @@ public partial class MainWindow : Window
_vm.SpineObjectListViewModel.RequestSelectionChanging += SpinesListView_RequestSelectionChanging;
_vm.SFMLRendererViewModel.RequestSelectionChanging += SpinesListView_RequestSelectionChanging;
_vm.PreferenceViewModel.PropertyChanged += PreferenceViewModel_PropertyChanged;
_vm.SFMLRendererViewModel.PropertyChanged += SFMLRendererViewModel_PropertyChanged;
}
/// <summary>
@@ -193,12 +193,27 @@ public partial class MainWindow : Window
private void MainWindow_ContentRendered(object? sender, EventArgs e)
{
string[] args = Environment.GetCommandLineArgs();
if (args.Length > 1)
// 不带参数启动
if (args.Length <= 1)
return;
// 带一个参数启动, 允许提供一些启动选项
if (args.Length == 2)
{
if (args[1] == App.AutoRunFlag)
{
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)
{
@@ -210,9 +225,9 @@ public partial class MainWindow : Window
#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))
{

View File

@@ -53,115 +53,219 @@
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel Grid.IsSharedSizeScope="True">
<GroupBox Header="{DynamicResource Str_TextureLoadPreference}">
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Col1"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_ForcePremul}" ToolTip="{DynamicResource Str_ForcePremulTooltip}"/>
<ToggleButton Grid.Row="0" Grid.Column="1" IsChecked="{Binding ForcePremul}" ToolTip="{DynamicResource Str_ForcePremulTooltip}"/>
<Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_ForceNearest}"/>
<ToggleButton Grid.Row="1" Grid.Column="1" IsChecked="{Binding ForceNearest}"/>
<Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource Str_ForceMipmap}" ToolTip="{DynamicResource Str_ForceMipmapTooltip}"/>
<ToggleButton Grid.Row="2" Grid.Column="1" IsChecked="{Binding ForceMipmap}" ToolTip="{DynamicResource Str_ForceMipmapTooltip}"/>
<Label Content="{DynamicResource Str_ForcePremul}" ToolTip="{DynamicResource Str_ForcePremulTooltip}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding ForcePremul}" ToolTip="{DynamicResource Str_ForcePremulTooltip}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_ForceNearest}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding ForceNearest}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_ForceMipmap}" ToolTip="{DynamicResource Str_ForceMipmapTooltip}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding ForceMipmap}" ToolTip="{DynamicResource Str_ForceMipmapTooltip}"/>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="{DynamicResource Str_SpineLoadPreference}">
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Col1"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<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"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_IsShown}"/>
<ToggleButton Grid.Row="0" Grid.Column="1" IsChecked="{Binding IsShown}"/>
<Label Grid.Row="1" Grid.Column="0" Content="{DynamicResource Str_UsePma}"/>
<ToggleButton Grid.Row="1" Grid.Column="1" IsChecked="{Binding UsePma}"/>
<Label Grid.Row="2" Grid.Column="0" Content="{DynamicResource Str_DebugTexture}"/>
<ToggleButton Grid.Row="2" Grid.Column="1" IsChecked="{Binding DebugTexture}"/>
<Label Grid.Row="3" Grid.Column="0" Content="{DynamicResource Str_DebugBounds}"/>
<ToggleButton Grid.Row="3" Grid.Column="1" IsChecked="{Binding DebugBounds}"/>
<Label Grid.Row="4" Grid.Column="0" Content="{DynamicResource Str_DebugBones}"/>
<ToggleButton Grid.Row="4" Grid.Column="1" IsChecked="{Binding DebugBones}"/>
<Label Grid.Row="5" Grid.Column="0" Content="{DynamicResource Str_DebugRegions}"/>
<ToggleButton Grid.Row="5" Grid.Column="1" IsChecked="{Binding DebugRegions}"/>
<Label Grid.Row="6" Grid.Column="0" Content="{DynamicResource Str_DebugMeshHulls}"/>
<ToggleButton Grid.Row="6" Grid.Column="1" IsChecked="{Binding DebugMeshHulls}"/>
<Label Grid.Row="7" Grid.Column="0" Content="{DynamicResource Str_DebugMeshes}"/>
<ToggleButton Grid.Row="7" Grid.Column="1" IsChecked="{Binding DebugMeshes}"/>
<Label Grid.Row="8" Grid.Column="0" Content="{DynamicResource Str_DebugClippings}"/>
<ToggleButton Grid.Row="8" Grid.Column="1" IsChecked="{Binding DebugClippings}"/>
<!--<Label Grid.Row="9" Grid.Column="0" Content="{DynamicResource Str_DebugBoundingBoxes}"/>
<ToggleButton Grid.Row="9" Grid.Column="1" IsChecked="{Binding DebugBoundingBoxes}"/>
<Label Grid.Row="10" Grid.Column="0" Content="{DynamicResource Str_DebugPaths}"/>
<ToggleButton Grid.Row="10" Grid.Column="1" IsChecked="{Binding DebugPaths}"/>
<Label Grid.Row="11" Grid.Column="0" Content="{DynamicResource Str_DebugPoints}"/>
<ToggleButton Grid.Row="11" Grid.Column="1" IsChecked="{Binding DebugPoints}"/>-->
<Label Content="{DynamicResource Str_IsShown}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding IsShown}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_UsePma}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding UsePma}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugTexture}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugTexture}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugBounds}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugBounds}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugBones}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugBones}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugRegions}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugRegions}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugMeshHulls}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugMeshHulls}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugMeshes}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugMeshes}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugClippings}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugClippings}"/>
</Grid>
<!-- <Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugBoundingBoxes}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugBoundingBoxes}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugPaths}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugPaths}"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_DebugPoints}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding DebugPoints}"/>
</Grid> -->
</StackPanel>
</GroupBox>
<GroupBox Header="{DynamicResource Str_AppPreference}">
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Col1"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Content="{DynamicResource Str_AutoRun}"/>
<ToggleButton Grid.Column="1"
IsChecked="{Binding AutoRun}"/>
</Grid>
<Label Grid.Row="0" Grid.Column="0" Content="{DynamicResource Str_WallpaperView}"/>
<ToggleButton Grid.Row="0" Grid.Column="1" IsChecked="{Binding WallpaperView}"/>
<Grid>
<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}"/>
<ToggleButton Grid.Row="1" Grid.Column="1" IsChecked="{Binding RenderSelectedOnly}"/>
<Grid>
<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}"/>
<ToggleButton Grid.Row="2" Grid.Column="1" IsChecked="{Binding AssociateFileSuffix}"/>
<Grid>
<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}"/>
<ComboBox Grid.Row="3" Grid.Column="1"
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource Str_AssociateFileSuffix}"/>
<ToggleButton Grid.Column="1"
IsChecked="{Binding AssociateFileSuffix}"/>
</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>
</StackPanel>
</ScrollViewer>