refactor: 是否显示精二干员开局由binding判断

This commit is contained in:
SherkeyXD
2023-09-26 15:50:35 +08:00
parent a6bd83e248
commit 2f87337235
2 changed files with 1 additions and 24 deletions

View File

@@ -1601,9 +1601,6 @@ namespace MaaWpfGui.ViewModels.UI
{
SetAndNotify(ref _roguelikeMode, value);
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeMode, value);
// 烧开水模式可选项
this.RoguelikeStartWithEliteTwoEnable = MapRoguelikeStartWithEliteTwoEnable(value);
}
}
@@ -1689,26 +1686,6 @@ namespace MaaWpfGui.ViewModels.UI
}
}
private string _roguelikeStartWithEliteTwoEnable = MapRoguelikeStartWithEliteTwoEnable(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeMode, "0"));
public string RoguelikeStartWithEliteTwoEnable
{
get
{
return _roguelikeStartWithEliteTwoEnable;
}
set
{
SetAndNotify(ref _roguelikeStartWithEliteTwoEnable, value);
}
}
private static string MapRoguelikeStartWithEliteTwoEnable(string mode)
{
return mode == "4" ? "Visible" : "Collapsed";
}
private string _roguelikeUseSupportUnit = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeUseSupportUnit, false.ToString());
/// <summary>

View File

@@ -108,7 +108,7 @@
<CheckBox
Margin="0,10"
IsChecked="{Binding RoguelikeStartWithEliteTwo}"
Visibility="{Binding RoguelikeStartWithEliteTwoEnable}">
Visibility="{c:Binding '(RoguelikeMode == &quot;4&quot;)'}">
<TextBlock
Block.TextAlignment="Left"
Text="{DynamicResource RoguelikeStartWithEliteTwo}"