PRISM リージョンがあります。
<ItemsControl prism:RegionManager.RegionName="{x:Static inf:RegionNames.AdministrationCommandsRegion}">
<ItemsControl.ItemTemplate>
...
</ItemsControl.ItemTemplate>
</ItemsControl>
リージョンマネージャーを使用してビューモデルを追加しています:
_regionManager.Regions[RegionNames.AdministrationCommandsRegion].Add(new CommandViewModel("User Management", new DelegateCommand(RequestNavigate));
CommandViewModel
次のようになります。
public class CommandViewModel
{
public CommandViewModel(string displayName, ICommand command)
{
if (command == null) throw new ArgumentNullException("command");
DisplayName = displayName;
Command = command;
}
public string DisplayName { get; private set; }
public ICommand Command { get; private set; }
}
リージョン内の の順序を指定したいのですが、インスタンスごとに異なるようにの属性CommandViewModels
を指定する方法が見つかりません。属性に依存する代わりに、ViewSortHint をコンストラクターに渡す方法はありますか?ViewSortHint
CommandViewModel
CommandViewModel