你的位置:首页 > 软件开发 > ASP.net > WPF使用样式更新ArcGis InfoWindow外观代码

WPF使用样式更新ArcGis InfoWindow外观代码

发布时间:2016-06-13 16:00:07
<Style x:Key="mainInfoWindowStyleMF" TargetType="{x:Type esri:InfoWindow}"> <Setter Property="Backgro ...
<Style x:Key="mainInfoWindowStyleMF" TargetType="{x:Type esri:InfoWindow}">      <Setter Property="Background" Value="Red"/>      <Setter Property="BorderBrush" Value="Blue"/>      <Setter Property="HorizontalAlignment" Value="Left"/>      <Setter Property="VerticalAlignment" Value="Top"/>      <Setter Property="Padding" Value="0"/>      <Setter Property="Margin" Value="0,20,0,0"></Setter>      <Setter Property="Template">        <Setter.Value>          <ControlTemplate TargetType="{x:Type esri:InfoWindow}">            <Grid x:Name="Root" Height="{TemplateBinding Height}" RenderTransformOrigin="{Binding RenderTransformOrigin, RelativeSource={RelativeSource TemplatedParent}}" SnapsToDevicePixels="True">              <Grid.RenderTransform>                <ScaleTransform ScaleY="0" ScaleX="0"/>              </Grid.RenderTransform>              <VisualStateManager.VisualStateGroups>                <VisualStateGroup x:Name="CommonStates">                  <VisualState x:Name="Show">                    <Storyboard>                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="Root">                        <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1">                          <EasingDoubleKeyFrame.EasingFunction>                            <BackEase Amplitude="0.5" EasingMode="EaseOut"/>                          </EasingDoubleKeyFrame.EasingFunction>                        </EasingDoubleKeyFrame>                      </DoubleAnimationUsingKeyFrames>                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="Root">                        <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1">                          <EasingDoubleKeyFrame.EasingFunction>                            <BackEase Amplitude="0.5" EasingMode="EaseOut"/>                          </EasingDoubleKeyFrame.EasingFunction>                        </EasingDoubleKeyFrame>                      </DoubleAnimationUsingKeyFrames>                    </Storyboard>                  </VisualState>                  <VisualState x:Name="Hide">                    <Storyboard>                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="Root">                        <EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="0">                          <EasingDoubleKeyFrame.EasingFunction>                            <CircleEase EasingMode="EaseIn"/>                          </EasingDoubleKeyFrame.EasingFunction>                        </EasingDoubleKeyFrame>                      </DoubleAnimationUsingKeyFrames>                      <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="Root">                        <EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="0">                          <EasingDoubleKeyFrame.EasingFunction>                            <CircleEase EasingMode="EaseIn"/>                          </EasingDoubleKeyFrame.EasingFunction>                        </EasingDoubleKeyFrame>                      </DoubleAnimationUsingKeyFrames>                    </Storyboard>                  </VisualState>                </VisualStateGroup>              </VisualStateManager.VisualStateGroups>              <Grid.RowDefinitions>                <RowDefinition Height="2*"></RowDefinition>                <RowDefinition Height="*"></RowDefinition>              </Grid.RowDefinitions>              <Border Grid.Row="0" BorderBrush="Red" BorderThickness="0" CornerRadius="30">                <Border.Background>                  <ImageBrush ImageSource="images\baseUC\32.png" Viewport="0,0 1,1" ViewportUnits="Absolute" TileMode="FlipXY"></ImageBrush>                </Border.Background>                <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"/>              </Border>              <Image Grid.Row="1" Source="images\baseUC\cor.png" VerticalAlignment="Top" HorizontalAlignment="Left"></Image>              <Path x:Name="BorderPath"/>              <!--Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding StrokeThickness}" StrokeLineJoin="Round"-->            </Grid>          </ControlTemplate>        </Setter.Value>      </Setter>    </Style>
WPF使用样式更新ArcGis InfoWindow外观代码WPF使用样式更新ArcGis InfoWindow外观代码
<esri:InfoWindow x:Name="InfoWinMF"             Placement="TopRight"             Padding="15"               Map="{Binding ElementName=mainmap}"             ContentTemplate="{StaticResource GeneralDataTemplate}"             Style="{DynamicResource mainInfoWindowStyleMF}"             Width="1400"             Height="1000"      />

原标题:WPF使用样式更新ArcGis InfoWindow外观代码

关键词:wpf

wpf
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。