fix:定级配置画面

master
sunhonglei 5 months ago
parent 6d47904824
commit 1b221173ea
  1. 9
      ViewModel/Configuration/LevelConfigVM.cs
  2. 2
      Views/Configuration/LevelConfigPage.xaml

@ -41,6 +41,8 @@ public class LevelConfigVM : BaseViewModel
public bool InstitutesEnabled { get { return _institutesEnabled; } set { _institutesEnabled = value; OnPropertyChanged("InstitutesEnabled"); } }
private bool _shapesEnabled = true;
public bool ShapesEnabled { get { return _shapesEnabled; } set { _shapesEnabled = value; OnPropertyChanged("ShapesEnabled"); } }
private bool _isUpdateButtonEnabled;
public bool IsUpdateButtonEnabled { get { return _isUpdateButtonEnabled; } set { _isUpdateButtonEnabled = value; OnPropertyChanged("IsUpdateButtonEnabled"); } }
JsonEntity jsonEntity = new JsonEntity();
@ -61,6 +63,7 @@ public class LevelConfigVM : BaseViewModel
SaveLevelConfigCommand = new RelayCommand(SaveLevelConfig);
InitLevelConfig(null);
InitData();
IsUpdateButtonEnabled = false;
}
/// <summary>
@ -482,6 +485,7 @@ public class LevelConfigVM : BaseViewModel
{
InstitutesEnabled = false;
ShapesEnabled = false;
IsUpdateButtonEnabled = true;
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
openFileDialog.Filter = "Text files (*.enc)|*.enc|All files (*.*)|*.*";
jsonEntity = null;
@ -499,6 +503,9 @@ public class LevelConfigVM : BaseViewModel
{
InstitutesEnabled = true;
ShapesEnabled = true;
IsUpdateButtonEnabled = false;
InitData();
ChangeShapeModel("");
return;
}
if (jsonEntity != null)
@ -571,7 +578,7 @@ public class LevelConfigVM : BaseViewModel
public void ChangeShapeModel(object param)
{
if (ShapeId!= null && ShapeId != string.Empty) {
setInstitutes(ShapeId);
InstituteId = setInstitutes(ShapeId);
}
}

@ -104,7 +104,7 @@
SelectionChanged="ChangeShapes" FontSize="16" Background="Transparent" BorderThickness="0"
IsEnabled="{Binding ShapesEnabled,Mode=TwoWay}" BorderBrush="Black"/>
</Border>
<Button Grid.Column="2" Grid.Row="0" Width="100" Margin="10 5 " Padding="0" Height="50"
<Button Grid.Column="2" Grid.Row="0" Width="100" Margin="10 5 " Padding="0" Height="50" IsEnabled="{Binding IsUpdateButtonEnabled}"
BorderThickness="0" Background="Transparent" FocusVisualStyle="{x:Null}" Command="{Binding SaveLevelConfigCommand}">
<Border HorizontalAlignment="Center"
VerticalAlignment="Center"

Loading…
Cancel
Save