내가 내 오버레이 팝업 디자인이 기본적으로이 좋아 UserControl을한다 :스타일 재사용 방법
<Grid VerticalAlignment="Center" HorizontalAlignment="Center" MaxWidth="400" MinHeight="150" MinWidth="250">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="42" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Path Grid.ColumnSpan="2" Data="M0,26 L27,26 L27,0 L26,0 z" Fill="#FFFFFF" />
<Border Background="#FFFFFF" Margin="27, 0, 0, 0" />
<Image
Source="/Infrastructure.SL;component/Images/img_logo.png"
Height="24" HorizontalAlignment="Left" Margin="15,0,0,0" />
<Image
Source="/Infrastructure.SL;component/Images/img_tab_ornament.png"
Height="26" HorizontalAlignment="Right"/>
<Border Grid.Row="1" Grid.RowSpan="3" BorderThickness="1" BorderBrush="#23ceff">
<Border.Effect>
<DropShadowEffect Opacity="0.75" Direction="-45" Color="Black" ShadowDepth="3"/>
</Border.Effect>
</Border>
<Border Grid.Row="2" Margin="1,0,1,1" Grid.RowSpan="2">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#fcfff4"/>
<GradientStop Color="#cfddea" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<my:DitatToolbar Grid.Row="1" Mode="Ok" Margin="1, 0, 1, 0" CaptionsOrientation="Horizontal"/>
<Image
Grid.Row="2" Height="32" Width="32"
VerticalAlignment="Bottom" HorizontalAlignment="Center"
Source="{Binding InteractionIconSource}" />
<TextBlock Grid.Row="3" Foreground="#3c3c3c" Text="{Binding Message}" HorizontalAlignment="Center" TextWrapping="Wrap" Margin="10" />
</Grid>
나는 약간의 차이와 같은 몇 가지 창을 설계 할 필요가있다. 이 XAML의 대부분은 재사용 할 수 있지만 어떻게 접근해야할지 모르겠습니다. 유일한 XAML은
<my:DitatToolbar Grid.Row="1" Mode="Ok" Margin="1, 0, 1, 0" CaptionsOrientation="Horizontal"/>
<Image
Grid.Row="2" Height="32" Width="32"
VerticalAlignment="Bottom" HorizontalAlignment="Center"
Source="{Binding InteractionIconSource}" />
<TextBlock Grid.Row="3" Foreground="#3c3c3c" Text="{Binding Message}" HorizontalAlignment="Center" TextWrapping="Wrap" Margin="10" />
다른 모든 것은 크롬입니다. 나는 한 곳에서만 그것을 정말로 갖고 싶다. 이 재사용을 위해 Silverlight에서 무엇을 사용할 수 있습니까?
기본 컨트롤을 만들고 상속하지만 XAML 측면에 익숙하지 않은 것 같습니다. 내 코드는 꽤 비어 있습니다. MVVM을 사용하고 있습니다.
렌더링 된 컨트롤의 모양을 게시 할 수 있습니까? 나는 당신이 그것을 보지 않고 성취하려는 것을 말할 수 없다. – terphi