zoukankan      html  css  js  c++  java
  • WPF使用样式更新ArcGis InfoWindow外观代码

    <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="imagesaseUC32.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="imagesaseUCcor.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>




    使用:

    <esri:InfoWindow x:Name="InfoWinMF" 
                             Placement="TopRight"
                             Padding="15"     
                             Map="{Binding ElementName=mainmap}" 
                             ContentTemplate="{StaticResource GeneralDataTemplate}"
                             Style="{DynamicResource mainInfoWindowStyleMF}"
                             Width="1400"
                             Height="1000"
                />
    View Code
    
    
    


  • 相关阅读:
    ThinkCMF框架任意内容包含
    网站防篡改脚本
    Apache Solr Velocity模板远程代码执行
    BurpSuite Intruder模块匹配返回包内容
    Kibana<6.6.0代码执行漏洞复现
    Thinkphp远程代码执行 payload汇总
    常用端口 简洁版
    NISP二级笔记(一) 信息安全管理
    oracle 中的角色
    oracle 用户对象权限
  • 原文地址:https://www.cnblogs.com/lopengye/p/5580728.html
Copyright © 2011-2022 走看看