Instruction file imported from Vladisl0ve/GTA-VC-BLR (
.cursor/rules/20-wpf-mvvm-localization.mdc). Copyright stays with the author.
WPF and MVVM rules
- Put layout, bindings, templates, and visual states in XAML; put state and actions in view models; keep code-behind limited to WPF-specific window/event plumbing that delegates to commands or services.
- Derive view models from
ObservableObject. Use[ObservableProperty],[RelayCommand],CanExecute, and[NotifyCanExecuteChangedFor]consistently. When a dependency changes, notify every affected computed property and command explicitly. - Route document-changing commands through the current busy/cancellation flow. Disable incompatible commands while busy, preserve the current document until a new one is fully loaded, prompt for unsaved changes, update
EditorSession.IsDirty, and refresh selection/filter state after a successful commit. - Preserve game gates: TXD and Windows-installer features are GTA Vice City-only; installer export/configuration additionally requires an attached TXD.
- Use
{loc:Translate Resource.Key}for visible XAML text andILocalizationService.Get/Formatin C#. Add every new key to bothLocalization/Strings.resxandLocalization/Strings.be-BY.resx; keep format placeholders identical. On language changes, rebuild/notify cached labels, option lists, status text, and computed UI strings. - Reuse Fluent dynamic resources and shared styles from
Themes/. Avoid hard-coded colors and duplicated control templates. Preserve keyboard gestures, accessibility labels/tooltips, binding modes, and enabled-state behavior when changing controls. - Keep dialogs behind
IDialogServiceso view-model behavior remains unit-testable. Do not callMessageBoxor file dialogs directly from a view model.