モーダル ダイアログを表示しようとしていますが、現在のシェル ウィンドウへの参照が必要です。
public class OpenPopupWindowAction : TriggerAction<FrameworkElement>
{
protected override void Invoke(object parameter)
{
var popup = new ChildWindow(); //(ChildWindow)ServiceLocator.Current.GetInstance<IPopupDialogWindow>();
popup.Owner = PlacementTarget ?? (Window)ServiceLocator.Current.GetInstance<IShell>();
私は得ています:
Cannot set Owner property to a Window that has not been shown previously.
これは Bootstrapper のコードです
public class Bootstrapper : UnityBootstrapper
{
protected override System.Windows.DependencyObject CreateShell()
{
Container.RegisterInstance<IShell>(new Shell());
return Container.Resolve<Shell>();
インターフェース:
public interface IShell
{
void InitializeComponent();
}
public partial class Shell : Window, PrismDashboard.IShell