wpf-rule-view-viewmodel-wiring-prism — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited wpf-rule-view-viewmodel-wiring-prism (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<!-- ============================================================================= AI Agent Reading Hint — wpf-dev-pack Composition Style Anchor =============================================================================
CANONICAL DEFINITIONS (per docs/TERMINOLOGY.md):
(Microsoft Learn: navigation identifier = View type name string)
+ IRegionManager.RequestNavigate("Region", "ViewName")
PROHIBITED (per prohibitions.md):
NOTE FOR AI AGENTS: Earlier plugin docs (≤ v1.5.x / v1.6.4) labeled the plugin uniformly as "View First MVVM". For this Prism path the underlying classification (View First) is actually correct, but the label was applied to the CommunityToolkit path too where it was incorrect. v1.6.4 corrects the labels per path. The enforced code rules are unchanged. Use v1.6.4+ terminology in generated code and comments. ============================================================================= -->
Applies when Prism 9 is the active MVVM framework. Mappings.xaml is NOT used with Prism.
Composition style: View First Composition + Stateful ViewModel (RegisterForNavigation+IRegionManager). Seedocs/TERMINOLOGY.md.
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterForNavigation<HomeView, HomeViewModel>();
containerRegistry.RegisterForNavigation<SettingsView, SettingsViewModel>();
}<Window x:Class="MyApp.MainWindow"
xmlns:prism="http://prismlibrary.com/">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="10">
<Button Content="Home" Command="{Binding NavigateCommand}"
CommandParameter="HomeView" Margin="5" />
<Button Content="Settings" Command="{Binding NavigateCommand}"
CommandParameter="SettingsView" Margin="5" />
</StackPanel>
<!-- Region instead of ContentControl + DataTemplate -->
<ContentControl Grid.Row="1"
prism:RegionManager.RegionName="ContentRegion" />
</Grid>
</Window>namespace MyApp.ViewModels;
public class MainWindowViewModel : BindableBase
{
private readonly IRegionManager _regionManager;
public MainWindowViewModel(IRegionManager regionManager)
{
_regionManager = regionManager;
}
private DelegateCommand<string>? _navigateCommand;
public DelegateCommand<string> NavigateCommand =>
_navigateCommand ??= new DelegateCommand<string>(ExecuteNavigate);
private void ExecuteNavigate(string viewName)
{
_regionManager.RequestNavigate("ContentRegion", viewName);
}
}private void NavigateToDetail(int userId)
{
var parameters = new NavigationParameters
{
{ "userId", userId },
{ "mode", "edit" }
};
_regionManager.RequestNavigate("ContentRegion", "DetailView", parameters);
}namespace MyApp.ViewModels;
public class HomeViewModel : BindableBase, INavigationAware
{
// Called when navigated to this View
public void OnNavigatedTo(NavigationContext navigationContext)
{
if (navigationContext.Parameters.ContainsKey("userId"))
{
var userId = navigationContext.Parameters.GetValue<int>("userId");
LoadUser(userId);
}
}
// Whether to reuse existing instance
public bool IsNavigationTarget(NavigationContext navigationContext)
{
return true;
}
// Called when navigating away
public void OnNavigatedFrom(NavigationContext navigationContext)
{
// Cleanup logic
}
}public class EditViewModel : BindableBase, IConfirmNavigationRequest
{
public void ConfirmNavigationRequest(
NavigationContext navigationContext,
Action<bool> continuationCallback)
{
if (HasUnsavedChanges)
{
var result = MessageBox.Show(
"You have unsaved changes. Navigate away?",
"Confirm", MessageBoxButton.YesNo);
continuationCallback(result == MessageBoxResult.Yes);
}
else
{
continuationCallback(true);
}
}
public void OnNavigatedTo(NavigationContext ctx) { }
public bool IsNavigationTarget(NavigationContext ctx) => true;
public void OnNavigatedFrom(NavigationContext ctx) { }
}| Item | CommunityToolkit.Mvvm | Prism 9 |
|---|---|---|
| View-VM mapping | DataTemplate in Mappings.xaml | RegisterForNavigation<V, VM>() |
| Navigation | Replace CurrentViewModel property | IRegionManager.RequestNavigate() |
| VM auto-wiring | DataTemplate DataType matching | DI container auto-resolve |
| Parameters | Manual property assignment | NavigationParameters (type-safe) |
| Lifecycle | None | INavigationAware, IConfirmNavigationRequest |
| Hosting control | ContentControl + Binding | ContentControl + RegionManager.RegionName |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.