Mini Kabibi Habibi
<local:MapDemoModule x:Class="MapDemo.Navigator"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxdb="http://schemas.devexpress.com/winfx/2008/xaml/demobase"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map"
xmlns:local="clr-namespace:MapDemo"
mc:Ignorable="d" d:DesignHeight="557" d:DesignWidth="2643">
<local:MapDemoModule.Resources>
<ResourceDictionary>
<local:DemoValuesProvider x:Key="DemoValuesProvider" />
<local:RouteModelStateToButtonTextConverter x:Key="StateToButtonTextConverter"/>
<local:RouteModelNormalStateToBoolConverter x:Key="NormalStateToBoolConverter"/>
<local:WaypointsCountToDriveAbilityConverter x:Key="WaypointsCountToDriveAbilityConverter"/>
<Style x:Key="ActionButtonStyle" TargetType="Button">
<Setter Property="FontSize" Value="23" />
<Setter Property="Foreground" Value="#FF3B3B3B" />
<Setter Property="Padding" Value="20,10"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="grid">
<Grid.Effect>
<DropShadowEffect Direction="-90" ShadowDepth="1" Opacity="0.5"/>
</Grid.Effect>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused"/>
<VisualState x:Name="Unfocused"/>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0" To="0.75" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border Background="Black" CornerRadius="5" Opacity="0.25" />
<Border Margin="1" CornerRadius="4" >
<Border.Background>
<LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
<GradientStop Color="White" Offset="1"/>
<GradientStop Color="#FFD4D4D4"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<Border Margin="2" CornerRadius="3" >
<Border.Background>
<LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
<GradientStop Color="#FFEEEEEE" Offset="1"/>
<GradientStop Color="#FFC7C7C7"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="DrivePushpinMarker">
<Grid x:Name="ContainerGrid" HorizontalAlignment="Center" Height="48" VerticalAlignment="Center" Width="48" Margin="-24,-24,0,0">
<Ellipse x:Name="Aura" Fill="#FFFFD339" Opacity="0.35"/>
<Ellipse x:Name="Marker" Width="16" Height="16">
<Ellipse.Effect>
<DropShadowEffect Direction="-90" ShadowDepth="1" BlurRadius="7" Opacity="0.5"/>
</Ellipse.Effect>
<Ellipse.Fill>
<LinearGradientBrush EndPoint="0.751,0.932" StartPoint="0.249,0.068">
<GradientStop Color="#FFF8EFAB"/>
<GradientStop Color="#FFF8EFAB" Offset="1"/>
<GradientStop Color="#FFFEBD05" Offset="0.65"/>
</LinearGradientBrush>
</Ellipse.Fill>
</Ellipse>
</Grid>
</DataTemplate>
</ResourceDictionary>
</local:MapDemoModule.Resources>
<dxdb:DemoModuleControl OptionsExpanded="False">
<dxdb:DemoModuleControl.OptionsContent>
<StackPanel MinWidth="200" HorizontalAlignment="Stretch">
<dx:GroupFrame Header="Time Scale">
<dxe:TrackBarEdit Minimum="1" Maximum="50" IsSnapToTickEnabled="False" Value="{Binding Path=TimeScale, Mode=TwoWay}"/>
</dx:GroupFrame>
</StackPanel>
</dxdb:DemoModuleControl.OptionsContent>
<Grid>
<dxm:MapControl ZoomLevel="14" FlowDirection="LeftToRight" CenterPoint="{Binding Path=MapCenter, Mode=TwoWay}">
<dxm:ImageTilesLayer>
<dxm:ImageTilesLayer.DataProvider>
<dxm:BingMapDataProvider Kind="Hybrid" BingKey="{Binding DevexpressBingKey, Source={StaticResource DemoValuesProvider}}"/>
</dxm:ImageTilesLayer.DataProvider>
</dxm:ImageTilesLayer>
<dxm:InformationLayer x:Name="geocodeInformationLayer" EnableHighlighting="true">
<dxm:InformationLayer.DataProvider>
<dxm:BingGeocodeDataProvider BingKey="{Binding DevexpressBingKey, Source={StaticResource DemoValuesProvider}}" ProcessMouseEvents="{Binding Path=State, Converter={StaticResource NormalStateToBoolConverter}}" LayerItemsGenerating="GeoCodeAndSearchLayerItemsGenerating" MaxVisibleResultCount="1"/>
</dxm:InformationLayer.DataProvider>
</dxm:InformationLayer>
<dxm:InformationLayer x:Name="routeInformationLayer" EnableHighlighting="False">
<dxm:InformationLayer.DataProvider>
<dxm:BingRouteDataProvider x:Name="routeDataProvider" BingKey="{Binding DevexpressBingKey, Source={StaticResource DemoValuesProvider}}" GenerateLayerItems="{Binding Path=State, Converter={StaticResource NormalStateToBoolConverter}}" LayerItemsGenerating="RouteItemsGenerating" RouteCalculated="RouteCalculated">
<dxm:BingRouteDataProvider.RouteStrokeStyle>
<dxm:StrokeStyle Thickness="3" DashCap="Round" StartLineCap="Round" EndLineCap="Round"></dxm:StrokeStyle>
</dxm:BingRouteDataProvider.RouteStrokeStyle>
</dxm:BingRouteDataProvider>
</dxm:InformationLayer.DataProvider>
</dxm:InformationLayer>
<dxm:VectorLayer ItemsSource="{Binding Path=Helpers}"/>
<dxm:VectorLayer ItemsSource="{Binding Path=DriveModel.DriveItems}" EnableHighlighting="False"/>
<dxm:InformationLayer x:Name="searchInformationLayer" EnableHighlighting="true">
<dxm:InformationLayer.DataProvider>
<dxm:BingSearchDataProvider BingKey="{Binding DevexpressBingKey, Source={StaticResource DemoValuesProvider}}" GenerateLayerItems="{Binding Path=State, Converter={StaticResource NormalStateToBoolConverter}}" LayerItemsGenerating="GeoCodeAndSearchLayerItemsGenerating" />
</dxm:InformationLayer.DataProvider>
</dxm:InformationLayer>
</dxm:MapControl>
<Grid VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,100">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="{Binding Path=State, Converter={StaticResource StateToButtonTextConverter}}" IsEnabled="{Binding Path=Waypoints.Count, Converter={StaticResource WaypointsCountToDriveAbilityConverter}}" Style="{StaticResource ActionButtonStyle}" MinWidth="160" Margin="3,0" Click="DriveClick"/>
<Button Grid.Column="1" Content="Clear" IsEnabled="{Binding Path=State, Converter={StaticResource NormalStateToBoolConverter}}" Style="{StaticResource ActionButtonStyle}" MinWidth="160" Margin="3,0" Click="ClearClick"/>
</Grid>
<Grid HorizontalAlignment="Center" VerticalAlignment="Top" Visibility="Visible" Width="555">
<Border Background="Black" Opacity="0.6" CornerRadius="0,0,10,10" />
<TextBlock TextWrapping="Wrap" TextAlignment="Center" Text="{Binding Path=ActionText}" Foreground="White" HorizontalAlignment="Center" FontSize="28" Margin="30,10,30,20"/>
</Grid>
</Grid>
</dxdb:DemoModuleControl>
</local:MapDemoModule>