• 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
    
    
    


  • 相关阅读:
    C++中的句柄类
    普林斯顿大学算法课 Algorithm Part I Week 3 自我总结
    普林斯顿大学算法课 Algorithm Part I Week 3 排序的应用 System Sorts
    普林斯顿大学算法课 Algorithm Part I Week 3 重复元素排序
    普林斯顿大学算法课 Algorithm Part I Week 3 求第K大数 Selection
    普林斯顿大学算法课 Algorithm Part I Week 3 快速排序 Quicksort
    普林斯顿大学算法课 Algorithm Part I Week 3 排序稳定性 Stability
    普林斯顿大学算法课 Algorithm Part I Week 3 比较器 Comparators
    普林斯顿大学算法课 Algorithm Part I Week 3 排序算法复杂度 Sorting Complexity
    普林斯顿大学算法课 Algorithm Part I Week 3 归并排序 Mergesort
  • 原文地址:https://www.cnblogs.com/lopengye/p/5580728.html
Copyright © 2020-2023  润新知