调整顺序
This commit is contained in:
@@ -75,24 +75,6 @@ namespace SpineViewer.Models
|
||||
|
||||
#region 程序选项
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _autoRun;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _autoRunWorkspaceConfigPath;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _wallpaperView;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _renderSelectedOnly;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _associateFileSuffix;
|
||||
|
||||
[ObservableProperty]
|
||||
private AppLanguage _appLanguage;
|
||||
|
||||
public RelayCommand Cmd_SelectAutoRunWorkspaceConfigPath => _cmd_SelectAutoRunWorkspaceConfigPath ??= new(() =>
|
||||
{
|
||||
if (!DialogService.ShowOpenJsonDialog(out var fileName))
|
||||
@@ -101,6 +83,24 @@ namespace SpineViewer.Models
|
||||
});
|
||||
private RelayCommand? _cmd_SelectAutoRunWorkspaceConfigPath;
|
||||
|
||||
[ObservableProperty]
|
||||
private AppLanguage _appLanguage;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _renderSelectedOnly;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _wallpaperView;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _autoRun;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _autoRunWorkspaceConfigPath;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _associateFileSuffix;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,12 +107,12 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
DebugPoints = DebugPoints,
|
||||
DebugClippings = DebugClippings,
|
||||
|
||||
AppLanguage = AppLanguage,
|
||||
RenderSelectedOnly = RenderSelectedOnly,
|
||||
WallpaperView = WallpaperView,
|
||||
AutoRun = AutoRun,
|
||||
AutoRunWorkspaceConfigPath = AutoRunWorkspaceConfigPath,
|
||||
WallpaperView = WallpaperView,
|
||||
RenderSelectedOnly = RenderSelectedOnly,
|
||||
AssociateFileSuffix = AssociateFileSuffix,
|
||||
AppLanguage = AppLanguage,
|
||||
};
|
||||
}
|
||||
set
|
||||
@@ -135,12 +135,12 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
DebugPoints = value.DebugPoints;
|
||||
DebugClippings = value.DebugClippings;
|
||||
|
||||
AppLanguage = value.AppLanguage;
|
||||
RenderSelectedOnly = value.RenderSelectedOnly;
|
||||
WallpaperView = value.WallpaperView;
|
||||
AutoRun = value.AutoRun;
|
||||
AutoRunWorkspaceConfigPath = value.AutoRunWorkspaceConfigPath;
|
||||
WallpaperView = value.WallpaperView;
|
||||
RenderSelectedOnly = value.RenderSelectedOnly;
|
||||
AssociateFileSuffix = value.AssociateFileSuffix;
|
||||
AppLanguage = value.AppLanguage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +246,24 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
|
||||
public static ImmutableArray<AppLanguage> AppLanguageOptions { get; } = Enum.GetValues<AppLanguage>().ToImmutableArray();
|
||||
|
||||
public AppLanguage AppLanguage
|
||||
{
|
||||
get => ((App)App.Current).Language;
|
||||
set => SetProperty(((App)App.Current).Language, value, v => ((App)App.Current).Language = v);
|
||||
}
|
||||
|
||||
public bool RenderSelectedOnly
|
||||
{
|
||||
get => _vmMain.SFMLRendererViewModel.RenderSelectedOnly;
|
||||
set => SetProperty(_vmMain.SFMLRendererViewModel.RenderSelectedOnly, value, v => _vmMain.SFMLRendererViewModel.RenderSelectedOnly = v);
|
||||
}
|
||||
|
||||
public bool WallpaperView
|
||||
{
|
||||
get => _vmMain.SFMLRendererViewModel.WallpaperView;
|
||||
set => SetProperty(_vmMain.SFMLRendererViewModel.WallpaperView, value, v => _vmMain.SFMLRendererViewModel.WallpaperView = v);
|
||||
}
|
||||
|
||||
public bool AutoRun
|
||||
{
|
||||
get => ((App)App.Current).AutoRun;
|
||||
@@ -258,30 +276,12 @@ namespace SpineViewer.ViewModels.MainWindow
|
||||
set => SetProperty(_vmMain.AutoRunWorkspaceConfigPath, value, v => _vmMain.AutoRunWorkspaceConfigPath = v);
|
||||
}
|
||||
|
||||
public bool WallpaperView
|
||||
{
|
||||
get => _vmMain.SFMLRendererViewModel.WallpaperView;
|
||||
set => SetProperty(_vmMain.SFMLRendererViewModel.WallpaperView, value, v => _vmMain.SFMLRendererViewModel.WallpaperView = v);
|
||||
}
|
||||
|
||||
public bool RenderSelectedOnly
|
||||
{
|
||||
get => _vmMain.SFMLRendererViewModel.RenderSelectedOnly;
|
||||
set => SetProperty(_vmMain.SFMLRendererViewModel.RenderSelectedOnly, value, v => _vmMain.SFMLRendererViewModel.RenderSelectedOnly = v);
|
||||
}
|
||||
|
||||
public bool AssociateFileSuffix
|
||||
{
|
||||
get => ((App)App.Current).AssociateFileSuffix;
|
||||
set => SetProperty(((App)App.Current).AssociateFileSuffix, value, v => ((App)App.Current).AssociateFileSuffix = v);
|
||||
}
|
||||
|
||||
public AppLanguage AppLanguage
|
||||
{
|
||||
get => ((App)App.Current).Language;
|
||||
set => SetProperty(((App)App.Current).Language, value, v => ((App)App.Current).Language = v);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,36 +203,10 @@
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="{DynamicResource Str_AutoRun}"/>
|
||||
<ToggleButton Grid.Column="1"
|
||||
IsChecked="{Binding AutoRun}"/>
|
||||
</Grid>
|
||||
|
||||
<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>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="{DynamicResource Str_WallpaperView}"/>
|
||||
<ToggleButton Grid.Column="1"
|
||||
IsChecked="{Binding WallpaperView}"/>
|
||||
<Label Content="{DynamicResource Str_Language}"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
SelectedItem="{Binding AppLanguage}"
|
||||
ItemsSource="{x:Static vm:PreferenceViewModel.AppLanguageOptions}"/>
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
@@ -250,9 +224,9 @@
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="LabelCol"/>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="{DynamicResource Str_AssociateFileSuffix}"/>
|
||||
<Label Content="{DynamicResource Str_WallpaperView}"/>
|
||||
<ToggleButton Grid.Column="1"
|
||||
IsChecked="{Binding AssociateFileSuffix}"/>
|
||||
IsChecked="{Binding WallpaperView}"/>
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
@@ -260,10 +234,36 @@
|
||||
<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}"/>
|
||||
<Label Content="{DynamicResource Str_AutoRun}"/>
|
||||
<ToggleButton Grid.Column="1"
|
||||
IsChecked="{Binding AutoRun}"/>
|
||||
</Grid>
|
||||
|
||||
<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" IsEnabled="{Binding AutoRun}">
|
||||
<Button DockPanel.Dock="Right"
|
||||
Content="..."
|
||||
Command="{Binding Cmd_SelectAutoRunWorkspaceConfigPath}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding AutoRunWorkspaceConfigPath}"
|
||||
ToolTip="{DynamicResource Str_AutoRunWorkspaceConfigPathTooltip}"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
<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>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
Reference in New Issue
Block a user