2016-09-09 6 views
0

XAMLファイル: -System.Windows.Markup.XamlParseExceptionが未処理だった、このエラーを示す私のWPFで

System.Windows.Markup.XamlParseExceptionは、未処理だった メッセージ:型「System.Windowsの未処理の例外。 Markup.XamlParseException 'がPresentationFramework.dllで発生しました 追加情報:' 'System.Windows.StaticResourceExtension'の値を指定すると例外がスローされました。行番号「42」および行位置「60」。以下は

Dictionary1.xamlのコードです:ここで

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
       xmlns:system="clr-namespace:System;assembly=mscorlib"> 
<!--xmlns:local="clr-namespace:HM.Desktop.Themes">--> 

<!--Basic Brushes--> 
<Color x:Key="PrimaryColor">#FF63AADA</Color> 
<Color x:Key="SecondaryColor">#FFA0FCFF</Color> 
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource PrimaryColor}" /> 
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource SecondaryColor}" /> 
<SolidColorBrush x:Key="TextBrush" Color="#FF152937" /> 
<SolidColorBrush x:Key="DisabledColor" Color="#8CFFFFFF" /> 
<SolidColorBrush x:Key="BackgroundBrush" Color="#FFFFFFFF" /> 
<LinearGradientBrush x:Key="MainBackground" EndPoint="0.5,1" StartPoint="0.5,0"> 
    <GradientStop Color="#FFCEDEFF" Offset="0" /> 
    <GradientStop Color="#FF5A7CA0" Offset="0.992" /> 
    <GradientStop Color="#FF5882A7" Offset="0.085" /> 
</LinearGradientBrush> 
<SolidColorBrush x:Key="WaitingAnimationColor" Color="DarkBlue" /> 

<!-- Button --> 
<Style TargetType="Button"> 
    <Setter Property="Foreground" Value="{StaticResource TextBrush}" /> 
    <!--<Setter Property="Background" Value="#00000000" />--> 
    <Setter Property="Background" Value="#000000FF" /> 
    <Setter Property="Padding" Value="5,4" /> 
    <Setter Property="Height" Value="35" /> 
    <Setter Property="FontSize" Value="14" /> 
    <Setter Property="FontWeight" Value="Bold" /> 
    <Setter Property="BorderBrush" Value="{StaticResource PrimaryBrush}" /> 
    <Setter Property="Template"> 
     <Setter.Value> 
      <ControlTemplate TargetType="Button"> 
       <Grid x:Name="Button_Normal"> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="50*" /> 
         <RowDefinition Height="50*" /> 
        </Grid.RowDefinitions> 
        <VisualStateManager.VisualStateGroups> 
         <VisualStateGroup x:Name="FocusStates"> 
          <VisualState x:Name="Unfocused" /> 
          <VisualState x:Name="Focused"> 
           <Storyboard> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerBorder" 
                    Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"> 
             <SplineColorKeyFrame KeyTime="0" Value="#BF000000" /> 
            </ColorAnimationUsingKeyFrames> 
           </Storyboard> 
          </VisualState> 
         </VisualStateGroup> 
         <VisualStateGroup x:Name="CommonStates"> 
          <VisualStateGroup.Transitions> 
           <VisualTransition GeneratedDuration="00:00:00.3" /> 
           <VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Pressed" /> 
           <VisualTransition From="MouseOver" GeneratedDuration="00:00:00.1" To="Normal" /> 
          </VisualStateGroup.Transitions> 
          <VisualState x:Name="MouseOver"> 
           <Storyboard> 
            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" 
                    Storyboard.TargetProperty="(UIElement.Opacity)"> 
             <SplineDoubleKeyFrame KeyTime="0" Value="1" /> 
            </DoubleAnimationUsingKeyFrames> 
            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" 
                    Storyboard.TargetProperty="(UIElement.Opacity)"> 
             <SplineDoubleKeyFrame KeyTime="0" Value="1" /> 
            </DoubleAnimationUsingKeyFrames> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Shadow" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
             <SplineColorKeyFrame KeyTime="0" 
                  Value="#4B000000" /> 
            </ColorAnimationUsingKeyFrames> 
            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="Background" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)"> 
             <SplineDoubleKeyFrame KeyTime="0" 
                   Value=".1" /> 
            </DoubleAnimationUsingKeyFrames> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="Highlight" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
             <SplineColorKeyFrame KeyTime="0" 
                  Value="#4AFFFFFF" /> 
            </ColorAnimationUsingKeyFrames> 
           </Storyboard> 
          </VisualState> 
          <VisualState x:Name="Normal" /> 
          <VisualState x:Name="Pressed"> 
           <Storyboard> 
            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="Background" 
                    Storyboard.TargetProperty="(UIElement.Opacity)"> 
             <SplineDoubleKeyFrame KeyTime="0" 
                   Value="0.6" /> 
            </DoubleAnimationUsingKeyFrames> 
            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="Background" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)"> 
             <SplineDoubleKeyFrame KeyTime="0" 
                   Value="0" /> 
            </DoubleAnimationUsingKeyFrames> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="White" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"> 
             <SplineColorKeyFrame KeyTime="0" 
                  Value="#FF000000" /> 
            </ColorAnimationUsingKeyFrames> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="White" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
             <SplineColorKeyFrame KeyTime="0" 
                  Value="#FFC8C8C8" /> 
            </ColorAnimationUsingKeyFrames> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="Highlight" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
             <SplineColorKeyFrame KeyTime="0" 
                  Value="#4BFFFFFF" /> 
            </ColorAnimationUsingKeyFrames> 
            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="Highlight" 
                    Storyboard.TargetProperty="(UIElement.Opacity)"> 
             <SplineDoubleKeyFrame KeyTime="0" 
                   Value="0.5" /> 
            </DoubleAnimationUsingKeyFrames> 
           </Storyboard> 
          </VisualState> 
          <VisualState x:Name="Disabled"> 
           <Storyboard> 
            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="contentPresenter" 
                    Storyboard.TargetProperty="(UIElement.Opacity)"> 
             <SplineDoubleKeyFrame KeyTime="0" 
                   Value="0.5" /> 
            </DoubleAnimationUsingKeyFrames> 
            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="Background" 
                    Storyboard.TargetProperty="(UIElement.Opacity)"> 
             <SplineDoubleKeyFrame KeyTime="0" 
                   Value="0.2" /> 
            </DoubleAnimationUsingKeyFrames> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="White" 
                    Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"> 
             <SplineColorKeyFrame KeyTime="0" 
                  Value="#FFB1B1B1" /> 
            </ColorAnimationUsingKeyFrames> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="White" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"> 
             <SplineColorKeyFrame KeyTime="0" 
                  Value="#FFECECEC" /> 
            </ColorAnimationUsingKeyFrames> 
            <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                    Storyboard.TargetName="White" 
                    Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
             <SplineColorKeyFrame KeyTime="0" 
                  Value="#FFECECEC" /> 
            </ColorAnimationUsingKeyFrames> 
           </Storyboard> 
          </VisualState> 
         </VisualStateGroup> 
        </VisualStateManager.VisualStateGroups> 
        <Border CornerRadius="4" 
          Grid.RowSpan="2" 
          x:Name="White" 
          BorderBrush="#FFFFFFFF" 
          BorderThickness="1.2"> 
         <Border.Background> 
          <RadialGradientBrush> 
           <RadialGradientBrush.RelativeTransform> 
            <TransformGroup> 
             <ScaleTransform CenterX="0.5" 
                 CenterY="0.5" 
                 ScaleX="1.35" 
                 ScaleY="1.35" /> 
            </TransformGroup> 
           </RadialGradientBrush.RelativeTransform> 
           <GradientStop Color="#FFFFFFFF" 
               Offset="0" /> 
           <GradientStop Color="#FFFFFFFF" 
               Offset="1" /> 
          </RadialGradientBrush> 
         </Border.Background> 
        </Border> 
        <Border BorderBrush="{TemplateBinding BorderBrush}" 
          BorderThickness="1.2" 
          CornerRadius="4" 
          x:Name="Background" 
          Grid.RowSpan="2" 
          Opacity="0.65"> 
         <Border.Background> 
          <LinearGradientBrush EndPoint="0.5,1.4" 
               StartPoint="0.5,0"> 
           <GradientStop Color="{StaticResource PrimaryColor}" 
               Offset="0.75" /> 
           <GradientStop Color="{StaticResource SecondaryColor}" 
               Offset="1" /> 
          </LinearGradientBrush> 
         </Border.Background> 
        </Border> 
        <Border Background="{TemplateBinding Background}" 
          BorderBrush="#7FFFFFFF" 
          BorderThickness="1" 
          CornerRadius="3.5" 
          x:Name="InnerBorder" 
          Margin="1" 
          Grid.RowSpan="2" /> 
        <Border CornerRadius="3.5" 
          x:Name="Shadow" 
          Margin="2" 
          Grid.RowSpan="2"> 
         <Border.OpacityMask> 
          <RadialGradientBrush> 
           <RadialGradientBrush.RelativeTransform> 
            <TransformGroup> 
             <TranslateTransform X="0" 
                  Y="-0.5" /> 
            </TransformGroup> 
           </RadialGradientBrush.RelativeTransform> 
           <GradientStop Color="#00FFFFFF" 
               Offset="0.3" /> 
           <GradientStop Color="#FFFFFFFF" 
               Offset="1" /> 
          </RadialGradientBrush> 
         </Border.OpacityMask> 
         <Border.Background> 
          <RadialGradientBrush> 
           <RadialGradientBrush.RelativeTransform> 
            <TransformGroup> 
             <ScaleTransform CenterX="0.5" 
                 CenterY="0.5" 
                 ScaleX="1.75" 
                 ScaleY="2.25" /> 
             <TranslateTransform Y="0.65" /> 
            </TransformGroup> 
           </RadialGradientBrush.RelativeTransform> 
           <GradientStop Color="#00000000" 
               Offset="0.55" /> 
           <GradientStop Color="#33000000" 
               Offset="1" /> 
          </RadialGradientBrush> 
         </Border.Background> 
        </Border> 
        <Border Margin="1,1,1,0" 
          CornerRadius="4,4,40,40" 
          x:Name="Highlight" 
          Opacity="0.8" 
          RenderTransformOrigin="0.5,1"> 
         <Border.Background> 
          <RadialGradientBrush> 
           <RadialGradientBrush.RelativeTransform> 
            <TransformGroup> 
             <ScaleTransform CenterX="0.5" 
                 CenterY="0.5" 
                 ScaleX="1.25" 
                 ScaleY="2" /> 
             <TranslateTransform Y="-0.6" /> 
            </TransformGroup> 
           </RadialGradientBrush.RelativeTransform> 
           <GradientStop Color="#BFFFFFFF" 
               Offset="0" /> 
           <GradientStop Color="#4CFFFFFF" 
               Offset="1" /> 
          </RadialGradientBrush> 
         </Border.Background> 
        </Border> 
        <ContentPresenter x:Name="contentPresenter" 
             HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
             VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
             Margin="{TemplateBinding Padding}" 
             RenderTransformOrigin="0.5,0.5" 
             Grid.RowSpan="2" /> 
       </Grid> 
      </ControlTemplate> 
     </Setter.Value> 
    </Setter> 
</Style> 
</ResourceDictionary> 

は、エラーが行で発生したコードは次のとおりです。<VisualState x:Name="Focused">

enter image description here

+0

あなたは、これは正しいファイルである一定のですか? –

+0

はい100%確実に、他のコントロールの不要なコードをコピーして削除しました。エラーが発生した場所のコードのみが保持されています。 – agileDev

+0

削除してください。誰にも役立つものは何も示していません。 –

答えて

0

あなたが作品を提供してきたスタイルと私は単純なウィンドウを作成してテストしました。このスタイルは問題を引き起こしていません。静的リソースは呼び出される前に使用されていますが、すべてのエラー状態です。

<Window x:Class="WpfApplication1.MainWindow" 
    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" 
    xmlns:local="clr-namespace:WpfApplication1" 
    mc:Ignorable="d" 
    Title="MainWindow" Height="350" Width="525"> 
<Window.Resources> 
    <Color x:Key="PrimaryColor">#FF63AADA</Color> 
    <Color x:Key="SecondaryColor">#FFA0FCFF</Color> 
    <SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource PrimaryColor}" /> 
    <SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource SecondaryColor}" /> 
    <SolidColorBrush x:Key="TextBrush" Color="#FF152937" /> 
    <SolidColorBrush x:Key="DisabledColor" Color="#8CFFFFFF" /> 
    <SolidColorBrush x:Key="BackgroundBrush" Color="#FFFFFFFF" /> 
    <LinearGradientBrush x:Key="MainBackground" EndPoint="0.5,1" StartPoint="0.5,0"> 
     <GradientStop Color="#FFCEDEFF" Offset="0" /> 
     <GradientStop Color="#FF5A7CA0" Offset="0.992" /> 
     <GradientStop Color="#FF5882A7" Offset="0.085" /> 
    </LinearGradientBrush> 
    <SolidColorBrush x:Key="WaitingAnimationColor" Color="DarkBlue" /> 

    <!-- Button --> 
    <Style TargetType="Button"> 
     <Setter Property="Foreground" Value="{StaticResource TextBrush}" /> 
     <!--<Setter Property="Background" Value="#00000000" />--> 
     <Setter Property="Background" Value="#000000FF" /> 
     <Setter Property="Padding" Value="5,4" /> 
     <Setter Property="Height" Value="35" /> 
     <Setter Property="FontSize" Value="14" /> 
     <Setter Property="FontWeight" Value="Bold" /> 
     <Setter Property="BorderBrush" Value="{StaticResource PrimaryBrush}" /> 
     <Setter Property="Template"> 
      <Setter.Value> 
       <ControlTemplate TargetType="Button"> 
        <Grid x:Name="Button_Normal"> 
         <Grid.RowDefinitions> 
          <RowDefinition Height="50*" /> 
          <RowDefinition Height="50*" /> 
         </Grid.RowDefinitions> 
         <VisualStateManager.VisualStateGroups> 
          <VisualStateGroup x:Name="FocusStates"> 
           <VisualState x:Name="Unfocused" /> 
           <VisualState x:Name="Focused"> 
            <Storyboard> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerBorder" 
                   Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"> 
              <SplineColorKeyFrame KeyTime="0" Value="#BF000000" /> 
             </ColorAnimationUsingKeyFrames> 
            </Storyboard> 
           </VisualState> 
          </VisualStateGroup> 
          <VisualStateGroup x:Name="CommonStates"> 
           <VisualStateGroup.Transitions> 
            <VisualTransition GeneratedDuration="00:00:00.3" /> 
            <VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Pressed" /> 
            <VisualTransition From="MouseOver" GeneratedDuration="00:00:00.1" To="Normal" /> 
           </VisualStateGroup.Transitions> 
           <VisualState x:Name="MouseOver"> 
            <Storyboard> 
             <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" 
                   Storyboard.TargetProperty="(UIElement.Opacity)"> 
              <SplineDoubleKeyFrame KeyTime="0" Value="1" /> 
             </DoubleAnimationUsingKeyFrames> 
             <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Highlight" 
                   Storyboard.TargetProperty="(UIElement.Opacity)"> 
              <SplineDoubleKeyFrame KeyTime="0" Value="1" /> 
             </DoubleAnimationUsingKeyFrames> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Shadow" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
              <SplineColorKeyFrame KeyTime="0" 
                 Value="#4B000000" /> 
             </ColorAnimationUsingKeyFrames> 
             <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="Background" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)"> 
              <SplineDoubleKeyFrame KeyTime="0" 
                  Value=".1" /> 
             </DoubleAnimationUsingKeyFrames> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="Highlight" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
              <SplineColorKeyFrame KeyTime="0" 
                 Value="#4AFFFFFF" /> 
             </ColorAnimationUsingKeyFrames> 
            </Storyboard> 
           </VisualState> 
           <VisualState x:Name="Normal" /> 
           <VisualState x:Name="Pressed"> 
            <Storyboard> 
             <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="Background" 
                   Storyboard.TargetProperty="(UIElement.Opacity)"> 
              <SplineDoubleKeyFrame KeyTime="0" 
                  Value="0.6" /> 
             </DoubleAnimationUsingKeyFrames> 
             <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="Background" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)"> 
              <SplineDoubleKeyFrame KeyTime="0" 
                  Value="0" /> 
             </DoubleAnimationUsingKeyFrames> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="White" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"> 
              <SplineColorKeyFrame KeyTime="0" 
                 Value="#FF000000" /> 
             </ColorAnimationUsingKeyFrames> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="White" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
              <SplineColorKeyFrame KeyTime="0" 
                 Value="#FFC8C8C8" /> 
             </ColorAnimationUsingKeyFrames> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="Highlight" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
              <SplineColorKeyFrame KeyTime="0" 
                 Value="#4BFFFFFF" /> 
             </ColorAnimationUsingKeyFrames> 
             <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="Highlight" 
                   Storyboard.TargetProperty="(UIElement.Opacity)"> 
              <SplineDoubleKeyFrame KeyTime="0" 
                  Value="0.5" /> 
             </DoubleAnimationUsingKeyFrames> 
            </Storyboard> 
           </VisualState> 
           <VisualState x:Name="Disabled"> 
            <Storyboard> 
             <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="contentPresenter" 
                   Storyboard.TargetProperty="(UIElement.Opacity)"> 
              <SplineDoubleKeyFrame KeyTime="0" 
                  Value="0.5" /> 
             </DoubleAnimationUsingKeyFrames> 
             <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="Background" 
                   Storyboard.TargetProperty="(UIElement.Opacity)"> 
              <SplineDoubleKeyFrame KeyTime="0" 
                  Value="0.2" /> 
             </DoubleAnimationUsingKeyFrames> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="White" 
                   Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"> 
              <SplineColorKeyFrame KeyTime="0" 
                 Value="#FFB1B1B1" /> 
             </ColorAnimationUsingKeyFrames> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="White" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"> 
              <SplineColorKeyFrame KeyTime="0" 
                 Value="#FFECECEC" /> 
             </ColorAnimationUsingKeyFrames> 
             <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                   Storyboard.TargetName="White" 
                   Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> 
              <SplineColorKeyFrame KeyTime="0" 
                 Value="#FFECECEC" /> 
             </ColorAnimationUsingKeyFrames> 
            </Storyboard> 
           </VisualState> 
          </VisualStateGroup> 
         </VisualStateManager.VisualStateGroups> 
         <Border CornerRadius="4" 
         Grid.RowSpan="2" 
         x:Name="White" 
         BorderBrush="#FFFFFFFF" 
         BorderThickness="1.2"> 
          <Border.Background> 
           <RadialGradientBrush> 
            <RadialGradientBrush.RelativeTransform> 
             <TransformGroup> 
              <ScaleTransform CenterX="0.5" 
                CenterY="0.5" 
                ScaleX="1.35" 
                ScaleY="1.35" /> 
             </TransformGroup> 
            </RadialGradientBrush.RelativeTransform> 
            <GradientStop Color="#FFFFFFFF" 
              Offset="0" /> 
            <GradientStop Color="#FFFFFFFF" 
              Offset="1" /> 
           </RadialGradientBrush> 
          </Border.Background> 
         </Border> 
         <Border BorderBrush="{TemplateBinding BorderBrush}" 
         BorderThickness="1.2" 
         CornerRadius="4" 
         x:Name="Background" 
         Grid.RowSpan="2" 
         Opacity="0.65"> 
          <Border.Background> 
           <LinearGradientBrush EndPoint="0.5,1.4" 
              StartPoint="0.5,0"> 
            <GradientStop Color="{StaticResource PrimaryColor}" 
              Offset="0.75" /> 
            <GradientStop Color="{StaticResource SecondaryColor}" 
              Offset="1" /> 
           </LinearGradientBrush> 
          </Border.Background> 
         </Border> 
         <Border Background="{TemplateBinding Background}" 
         BorderBrush="#7FFFFFFF" 
         BorderThickness="1" 
         CornerRadius="3.5" 
         x:Name="InnerBorder" 
         Margin="1" 
         Grid.RowSpan="2" /> 
         <Border CornerRadius="3.5" 
         x:Name="Shadow" 
         Margin="2" 
         Grid.RowSpan="2"> 
          <Border.OpacityMask> 
           <RadialGradientBrush> 
            <RadialGradientBrush.RelativeTransform> 
             <TransformGroup> 
              <TranslateTransform X="0" 
                 Y="-0.5" /> 
             </TransformGroup> 
            </RadialGradientBrush.RelativeTransform> 
            <GradientStop Color="#00FFFFFF" 
              Offset="0.3" /> 
            <GradientStop Color="#FFFFFFFF" 
              Offset="1" /> 
           </RadialGradientBrush> 
          </Border.OpacityMask> 
          <Border.Background> 
           <RadialGradientBrush> 
            <RadialGradientBrush.RelativeTransform> 
             <TransformGroup> 
              <ScaleTransform CenterX="0.5" 
                CenterY="0.5" 
                ScaleX="1.75" 
                ScaleY="2.25" /> 
              <TranslateTransform Y="0.65" /> 
             </TransformGroup> 
            </RadialGradientBrush.RelativeTransform> 
            <GradientStop Color="#00000000" 
              Offset="0.55" /> 
            <GradientStop Color="#33000000" 
              Offset="1" /> 
           </RadialGradientBrush> 
          </Border.Background> 
         </Border> 
         <Border Margin="1,1,1,0" 
         CornerRadius="4,4,40,40" 
         x:Name="Highlight" 
         Opacity="0.8" 
         RenderTransformOrigin="0.5,1"> 
          <Border.Background> 
           <RadialGradientBrush> 
            <RadialGradientBrush.RelativeTransform> 
             <TransformGroup> 
              <ScaleTransform CenterX="0.5" 
                CenterY="0.5" 
                ScaleX="1.25" 
                ScaleY="2" /> 
              <TranslateTransform Y="-0.6" /> 
             </TransformGroup> 
            </RadialGradientBrush.RelativeTransform> 
            <GradientStop Color="#BFFFFFFF" 
              Offset="0" /> 
            <GradientStop Color="#4CFFFFFF" 
              Offset="1" /> 
           </RadialGradientBrush> 
          </Border.Background> 
         </Border> 
         <ContentPresenter x:Name="contentPresenter" 
            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
            Margin="{TemplateBinding Padding}" 
            RenderTransformOrigin="0.5,0.5" 
            Grid.RowSpan="2" /> 
        </Grid> 
       </ControlTemplate> 
      </Setter.Value> 
     </Setter> 
    </Style> 
</Window.Resources> 
<Grid> 
    <Button Content="test" Height="50" Width="100"/> 
</Grid> 

+0

これは役に立つ情報ですが、答えではありません。 –

+0

あなたは私に何かを証明する必要はありません。私はOPではなく、あなたのテストは、彼のXAMLの42行目を見てから推測したことを確認します。あなたの最初の文は非常に良いコメントでした。 XAMLを含める必要はありません。もし彼があなたが言っていることを疑うならば、彼は自分自身をチェックすることができます。 「私はX自身を試してYを見つけた」のようなコメントは、ここでは非常に一般的で、一般的には便利です。 –

+0

私が言っていることはちょうど、それは質問に答えることができない場合、答えとして物事を投稿しないというルールがあります。 *間違った答えかもしれません。ただ答える必要があります。 –

関連する問題