1

グリッド コンテナの背景に線を保存して表示するにはどうすればよいですか? リソース ディクショナリごとに背景を設定する必要がありました。

<Style TargetType="{x:Type Grid}">
    <Setter Property="Background">
        <Setter.Value>
            <!--here I had to display a vertical line at bottom,
                which goes over the whole window -->
        </Setter.Value>
    </Setter>
</Style>

また:

<Style TargetType="{x:Type Window}">
    <Setter Property="Background">
        <Setter.Value>
            <!-- here I had to display a vertical line at bottom,
                 which goes over the whole window and set the background color-->
        </Setter.Value>
    </Setter>
</Style>

スクリーンショット

問題は、アプリケーションの各ウィンドウに赤いフッターが必要なことです。ResourceDictionaryスタイリングに使っています。実行時/アプリケーションごとに色を設定する必要があるため、画像を使用できません。

4

1 に答える 1

0

ブラシ自体を使用できます。

visualbrush を使用すると、何でもブラシとして描画できます: http://msdn.microsoft.com/de-de/library/system.windows.media.visualbrush.aspx

そのようなことをするだけ

<VisualBrush>
...
<Grid Background="Red" .../>
<Line ... />

</VisualBrush>
于 2012-08-10T13:55:30.047 に答える