You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9 KiB
C#

using SlnMesnac.WPF.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SlnMesnac.WPF.Page
{
/// <summary>
/// BaseConfigInfoPage.xaml 的交互逻辑
/// </summary>
public partial class BaseConfigInfoPage : UserControl
{
private BaseConfigInfoViewModel ViewModel;
public BaseConfigInfoPage()
{
InitializeComponent();
ViewModel = new BaseConfigInfoViewModel();
this.DataContext = ViewModel;
}
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
string configKey = ConfigKey.Text;
string configName = ConfigName.Text;
string configValue = ConfigValue.Text;
string configFlag = ConfigFlag.Text;
// 调用 ViewModel 中的方法并传递参数
ViewModel.Save(configKey, configName, configValue, configFlag);
}
private void EditButton_Click(object sender, RoutedEventArgs e)
{
1 week ago
var result = MessageBox.Show("确认修改吗","确认框", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
string configId = ConfigId.Text;
string configKey = ConfigKey.Text;
string configName = ConfigName.Text;
string configValue = ConfigValue.Text;
string configFlag = ConfigFlag.Text;
// 调用 ViewModel 中的方法并传递参数
ViewModel.Edit(configId, configKey, configName, configValue, configFlag);
}
}
}
}