| 123456789101112131415161718192021222324252627282930 |
- using System.Collections.Generic;
- using System.Windows;
- using LocalizationTool.Models;
- using LocalizationTool.ViewModels;
- namespace LocalizationTool.Views
- {
- /// <summary>手动新增词条窗口:中文 key 必填,各语言译文可留空(= 缺译)。</summary>
- public partial class AddEntryWindow : Window
- {
- public AddEntryViewModel ViewModel { get; }
- public string EntryKey => ViewModel.Key?.Trim();
- public Dictionary<string, string> EntryTranslations => ViewModel.CollectTranslations();
- public AddEntryWindow(List<PackFile> langs)
- {
- InitializeComponent();
- Icon = App.AppIcon;
- ViewModel = new AddEntryViewModel(langs ?? new List<PackFile>());
- DataContext = ViewModel;
- ViewModel.RequestClose += ok =>
- {
- DialogResult = ok;
- Close();
- };
- }
- }
- }
|