Coding 4 FunのMessagePromptの枠線を除去(Border)

5526 ワード

 App.xaml 

xmlns:c4f="clr-namespace:Coding4Fun.Toolkit.Controls;assembly=Coding4Fun.Toolkit.Controls"

    



    <!-- -->

    <Application.Resources>

<ControlTemplate x:Key="MsgPropmtNoBorder" TargetType="c4f:MessagePrompt">

            <Grid VerticalAlignment="Stretch">

                <Rectangle Fill="{StaticResource TransparentBrush}"/>

                <Border VerticalAlignment="Top" Margin="10" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="5" CornerRadius="10">

                    <StackPanel Margin="10">

                        <TextBlock Text="{TemplateBinding Title}" Margin="0,-10,-25,10" FontSize="30" TextWrapping="Wrap" FontFamily="Segoe WP Light"/>

                        <ContentPresenter Content="{TemplateBinding Body}"/>

                        <StackPanel Margin="0,10,0,0" Name="actionButtonArea" Orientation="Horizontal" HorizontalAlignment="Center"/>

                    </StackPanel>

                </Border>

            </Grid>

        </ControlTemplate>





    </Application.Resources>
 :

MessagePrompt textBoxMsgPrompt = new MessagePrompt();

            textBoxMsgPrompt.Template = Application.Current.Resources["MsgPropmtNoBorder"] as ControlTemplate;