wpf-rule-view-viewmodel-wiring-prism
View-ViewModel wiring for Prism 9: RegisterForNavigation + IRegionManager (View First).
от christian289★ 42 звезды на GitHub
Установить wpf-rule-view-viewmodel-wiring-prism в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
View-ViewModel Wiring — Prism 9
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.
Registration in App.xaml.cs
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterForNavigation<HomeView, HomeViewModel>();
containerRegistry.RegisterForNavigation<SettingsView, SettingsViewModel>();
}
Shell — Region Definition
<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>
Shell ViewModel — Navigation
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);
}
}
NavigationParameters
private void NavigateToDetail(int userId)
{
var parameters = new NavigationParameters
{
{ "userId", userId },
{ "mode", "edit" }
};
_regionManager.RequestNavigate("ContentRegion", "DetailView", parameters);
}
INavigationAware — Lifecycle Callbacks
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
}
}
IConfirmNavigationRequest — Cancel Navigation
public class EditViewModel : BindableBase, IConfirmNavigationRequest
{
public void ConfirmNavigationRequest(
NavigationContext navigationC
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл wpf-rule-view-viewmodel-wiring-prism?
View-ViewModel wiring for Prism 9: RegisterForNavigation + IRegionManager (View First).
Как установить скилл wpf-rule-view-viewmodel-wiring-prism?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл wpf-rule-view-viewmodel-wiring-prism запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…