XAMLを通じてウィンドウの所有者をApplication.Current.MainWindow
に設定するにはどうすればよいですか? これまで私はこれを試しました:WPFでウィンドウの所有者をMainWindowトラフXAMLに設定する方法は?
<Window x:Class="ModalWindow.CustomModalWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Owner="System.Windows.Application.Current.MainWindow">
<!--Some XAML code-->
</Window>
それは動作しませんでした。 「System.Windows.Application.Current.MainWindow」は単なる文字列
Window.Owner
あるので
なぜWindow.Ownerを設定しますか? 何を達成したいですか? –