次のようなモーダル WPF ウィンドウを作成しました。

ウィンドウのコードは次のとおりです。
<Window x:Class="Dionysus.Core.Controls.ModalWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ModalWindow" AllowsTransparency="True" Background="Transparent" WindowStyle="None">
<Grid Name="MainGrid">
    <Rectangle Fill="Gray" Opacity="0.7" />
</Grid>
次に、「ErrorControl」が次のように追加されます。
MainGrid.Children.Add(uc);
問題は、スタック トレースを展開するとすぐに、コントロールの透明度も変化することです。

ScrollViewerこれは、誤った透明度を使用する 、つまり をRectangle含む の代わりにを使用することと関係があると思いますWindow。
Opacityまた、UserControlを所有する のを 1 に設定し、ScrollViewerをバインドしましたOpacity。
<ScrollViewer Background="WhiteSmoke" Opacity="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=Opacity}">
誰でも私を助けることができますか?
--
アップデート
UserControlに挿入されるのコードは次のとおりです。Window
<Grid x:Name="LayoutRootx" Background="WhiteSmoke">
        <StackPanel VerticalAlignment="Stretch">
            <TextBlock TextWrapping="Wrap" Margin="5" Text="An error has occured:" Foreground="Black" FontSize="15" FontWeight="Medium"/>
            <TextBlock TextWrapping="Wrap" Margin="5,10,5,5" Text="{Binding Error}"/>
            <odc:OdcExpander Header="Stack Trace" Margin="5" IsExpanded="False" Background="WhiteSmoke">
                <TextBox Text="{Binding StackTrace}" TextWrapping="Wrap" Margin="5,10,5,5" IsReadOnly="True" MaxHeight="370"/>
            </odc:OdcExpander>
            <odc:OdcExpander Header="Comment" Margin="5" IsExpanded="False">
                <TextBox Text="{Binding Comment}" TextWrapping="Wrap" Margin="5,10,5,5" MaxHeight="370" Name="txtComment"/>
            </odc:OdcExpander>
            <StackPanel Margin="5,10,5,5" Orientation="Horizontal" HorizontalAlignment="Left">
                <Button Style="{StaticResource DionysusButton}"  Width="100" Height="23" IsDefault="True" Name="btnSendError">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Dionysus.Shell;component/Images/camera-icon.png" Margin="0,0,5,0">
                        </Image>
                        <TextBlock Text="Send to IT" VerticalAlignment="Center"/>
                        <core:DionysusTriggerAction Height="0" Width="0" TargetControl="{Binding ElementName=btnSendError}" MethodName="SendError"></core:DionysusTriggerAction>
                    </StackPanel>
                </Button>
                <Button Style="{StaticResource DionysusButton}"  Width="100" Height="23" Name="btnExit" Margin="10,0,0,0" IsCancel="True">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Dionysus.Shell;component/Images/DeleteRed.png" Margin="0,0,5,0">
                        </Image>
                        <TextBlock Text="Close" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
                <core:DionysusTriggerAction Height="0" Name="triggerAction2" Width="0" TargetControl="{Binding ElementName=btnExit}" MethodName="Exit"></core:DionysusTriggerAction>
            </StackPanel>
        </StackPanel>
    </Grid>
    