123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352 |
- <UserControl x:Class="PRSDesktop.LiveMapsPanel"
- 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:syncfusion="http://schemas.syncfusion.com/wpf"
- xmlns:dynamicGrid="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
- xmlns:prsDesktop="clr-namespace:PRSDesktop"
- xmlns:dynamicGrid1="clr-namespace:InABox.Wpf.DynamicGrid;assembly=InABox.Wpf"
- xmlns:wpf="clr-namespace:InABox.Wpf;assembly=InABox.Wpf"
- xmlns:classes="clr-namespace:Comal.Classes;assembly=PRSClasses"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
-
- <UserControl.DataContext>
- <prsDesktop:LiveMapsPanelViewModel x:Name="ViewModel" />
- </UserControl.DataContext>
-
- <UserControl.Resources>
- <prsDesktop:TestConverter x:Key="TestConverter" />
- <prsDesktop:EquipmentThumbnailConverter x:Key="EquipmentThumbnailConverter" />
- <prsDesktop:EquipmentColorConverter x:Key="EquipmentColorConverter" />
- <prsDesktop:GeoFenceImageConverter x:Key="GeoFenceImageConverter" />
- <prsDesktop:MarkerAlignmentConverter x:Key="MarkerAlignmentConverter"/>
-
- <DataTemplate x:Key="AssetMarkerTemplate" DataType="{x:Type prsDesktop:AssetMapMarker}">
-
- <Border
- BorderBrush="Purple"
- BorderThickness="0.75"
- CornerRadius="10"
- Padding="2"
- Width="20"
- Height="20"
- Margin="-10,-10,10,10"
- >
- <Border.Background>
- <SolidColorBrush Color="Orchid" Opacity ="0.8" />
- </Border.Background>
- <Border.ToolTip>
- <Label Content ="{Binding Label}" />
- </Border.ToolTip>
- </Border>
-
- </DataTemplate>
-
- <DataTemplate x:Key="SiteMarkerTemplate" DataType="{x:Type prsDesktop:SiteMapMarker}">
-
- <Border
- BorderBrush="Gray"
- BorderThickness="0.75"
- CornerRadius="0,5,5,5"
- Padding="2">
- <Label Content ="{Binding Label}" />
- <Border.Background>
- <SolidColorBrush Color="LightYellow" Opacity ="0.8" />
- </Border.Background>
- </Border>
-
- </DataTemplate>
- <prsDesktop:MarkerTemplateSelector x:Key="markerTemplateSelector"
- SiteMarkerTemplate="{StaticResource SiteMarkerTemplate}"
- AssetMarkerTemplate="{StaticResource AssetMarkerTemplate}"/>
-
- <Style x:Key="EquipmentListBoxItemContainerStyle" TargetType="ListBoxItem">
- <Setter Property="Height" Value="50" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="0,0,0,0" />
- <Setter Property="Margin" Value="-1" />
- </Style>
-
- <Style x:Key="SiteListBoxItemContainerStyle" TargetType="ListBoxItem">
- <Setter Property="Height" Value="60" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="0,0,0,0" />
- <Setter Property="Margin" Value="-1" />
- </Style>
-
- <DataTemplate x:Key="EquipmentListBoxItemTemplate" DataType="{x:Type classes:Equipment}">
-
- <Grid>
- <Grid.Background>
- <SolidColorBrush
- Opacity="0.5"
- Color="{Binding ., Converter={StaticResource EquipmentColorConverter}}" />
- </Grid.Background>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50"/>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Image
- Grid.Row="0"
- Grid.Column="0"
- Grid.RowSpan="2"
- Margin="5"
- Source="{Binding GroupLink.Thumbnail.ID, Converter={StaticResource EquipmentThumbnailConverter}}"
- VerticalAlignment="Center"
- HorizontalAlignment="Center"/>
- <Label
- Grid.Row="0"
- Grid.Column="1"
- Grid.ColumnSpan="3"
- Content="{Binding Description}"
- FontWeight="DemiBold"/>
- <Label
- Grid.Row="1"
- Grid.Column="1"
- Content="{Binding Code}"/>
- <Label
- Grid.Row="1"
- Grid.Column="2"
- HorizontalContentAlignment="Center"
- Content="{Binding TrackerLink.Location.Timestamp}"
- ContentStringFormat="{}{0:dd-MMM-yy}"/>
- <Label
- Grid.Row="1"
- Grid.Column="3"
- Content="{Binding TrackerLink.DeviceID}"/>
- <Border
- Grid.Row="2"
- Grid.Column="0"
- Grid.ColumnSpan="4"
- BorderThickness="0,0.75,0,0"
- BorderBrush="Gray"
- Margin="0"
- Padding="0"
- Height="0.75"/>
-
- </Grid>
- </DataTemplate>
-
- <DataTemplate x:Key="SiteListBoxItemTemplate" DataType="{x:Type classes:GeoFence}">
-
- <Grid>
- <Grid.Background>
- <SolidColorBrush Opacity="0.5" Color="LightYellow" />
- </Grid.Background>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="60"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Image
- Grid.Row="0"
- Grid.Column="0"
- Grid.RowSpan="3"
- Margin="10"
- Source="{Binding Type, Converter={StaticResource GeoFenceImageConverter}}"
- VerticalAlignment="Center"
- HorizontalAlignment="Center"/>
- <TextBlock
- Grid.Row="0"
- Grid.Column="1"
- FontWeight="DemiBold">
- <Run Text="{Binding Code}" />
- <Run Text=" - " />
- <Run Text="{Binding Name}" />
- </TextBlock>
-
- <TextBlock
- Grid.Row="1"
- Grid.Column="1"
- VerticalAlignment="Center">
- <Run Text="{Binding Street}"/>
- </TextBlock>
-
- <TextBlock
- Grid.Row="2"
- Grid.Column="1">
- <Run Text="{Binding City}"/>
- <Run Text="{Binding State}"/>
- <Run Text="{Binding PostCode}"/>
- </TextBlock>
- <Border
- Grid.Row="3"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- BorderThickness="0,0.75,0,0"
- BorderBrush="Gray"
- Margin="0"
- Padding="0"
- Height="0.75"/>
- </Grid>
- </DataTemplate>
-
- </UserControl.Resources>
-
- <dynamicGrid:DynamicSplitPanel
- View="Combined"
- AllowableViews="Combined"
- Anchor="Master"
- AnchorWidth="300"
- >
-
- <dynamicGrid:DynamicSplitPanel.Master>
- <DockPanel>
- <ComboBox
- DockPanel.Dock="Top"
- x:Name="ViewSites"
- Padding="5"
- VerticalContentAlignment="Center"
- ItemsSource="{Binding SiteTypes}"
- SelectedItem="{Binding SelectedSiteType, Mode=TwoWay}"
- SelectedValuePath="Item1"
- DisplayMemberPath="Item2" />
- <TextBox
- DockPanel.Dock="Top"
- x:Name="SearchSites"
- Background="LightYellow"
- Padding="5"
- Margin="0,4,0,0"
- HorizontalContentAlignment="Left"
- VerticalContentAlignment="Center"
- wpf:TextBoxUtils.Placeholder="Search Sites"
- Text="{Binding EquipmentSearch, Mode=TwoWay}"/>
- <ListBox
- DockPanel.Dock="Top"
- Margin="0,4,0,0"
- ItemsSource="{Binding VisibleSites}"
- BorderThickness="0.75"
- BorderBrush="Gray"
- SelectedItem="{Binding SelectedSite, Mode=TwoWay}"
- Padding="0"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- ItemContainerStyle="{StaticResource SiteListBoxItemContainerStyle}"
- ItemTemplate="{StaticResource SiteListBoxItemTemplate}"/>
- </DockPanel>
-
- </dynamicGrid:DynamicSplitPanel.Master>
-
- <dynamicGrid:DynamicSplitPanel.Detail>
-
- <dynamicGrid:DynamicSplitPanel
- View="Combined"
- AllowableViews="Combined"
- Anchor="Detail"
- AnchorWidth="300"
- >
-
- <dynamicGrid:DynamicSplitPanel.Master>
- <syncfusion:SfMap
- x:Name="Map"
- Grid.Column="1"
- Grid.Row="0"
- BorderBrush="Gray"
- BorderThickness="0.75"
- ZoomedIn="Map_OnZoomed"
- ZoomedOut="Map_OnZoomed"
- Panned="Map_OnPanned"
- >
- <syncfusion:SfMap.Layers>
- <syncfusion:ImageryLayer
- x:Name="ImageryLayer"
- Center="{Binding Center, Mode=TwoWay}"
- Radius="{Binding Radius, Mode=TwoWay}"
- DistanceType="KiloMeter"
- Markers="{Binding Markers, Mode=TwoWay}"
- MarkerTemplateSelector="{StaticResource markerTemplateSelector}"
- MarkerHorizontalAlignment="Far"
- MarkerVerticalAlignment="Far">
- <syncfusion:ImageryLayer.SubShapeFileLayers>
- <syncfusion:SubShapeFileLayer
- MapElements="{Binding Elements}" >
- </syncfusion:SubShapeFileLayer>
- </syncfusion:ImageryLayer.SubShapeFileLayers>
-
- </syncfusion:ImageryLayer>
- </syncfusion:SfMap.Layers>
- </syncfusion:SfMap>
- </dynamicGrid:DynamicSplitPanel.Master>
-
-
- <dynamicGrid:DynamicSplitPanel.Detail>
- <DockPanel>
- <ComboBox
- DockPanel.Dock="Top"
- x:Name="ViewGroup"
- Padding="5"
- VerticalContentAlignment="Center"
- ItemsSource="{Binding EquipmentGroups}"
- SelectedItem="{Binding SelectedEquipmentGroup, Mode=TwoWay}"
- DisplayMemberPath="Description" />
-
- <TextBox
- DockPanel.Dock="Top"
- x:Name="SearchAssets"
- Background="LightYellow"
- Padding="5"
- Margin="0,4,0,0"
- HorizontalContentAlignment="Left"
- VerticalContentAlignment="Center"
- wpf:TextBoxUtils.Placeholder="Search"
- Text="{Binding EquipmentSearch, Mode=TwoWay}"/>
-
- <Border
- DockPanel.Dock="Top"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Margin="0,4,0,0"
- Background="White">
- <syncfusion:CalendarEdit
- x:Name="Date"
- ShowAbbreviatedMonthNames="True"
- AllowMultiplySelection="False"
- Date="{Binding Date, Mode=TwoWay}"
- BorderBrush="Transparent" />
- </Border>
-
- <ListBox
- x:Name="Markers"
- DockPanel.Dock="Top"
- Margin="0,4,0,0"
- ItemsSource="{Binding VisibleEquipment}"
- BorderThickness="0.75"
- SelectedItem="{Binding SelectedEquipment, Mode=TwoWay}"
- Padding="0"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- ItemContainerStyle="{StaticResource EquipmentListBoxItemContainerStyle}"
- ItemTemplate="{StaticResource EquipmentListBoxItemTemplate}" />
-
- </DockPanel>
-
- </dynamicGrid:DynamicSplitPanel.Detail>
- </dynamicGrid:DynamicSplitPanel>
- </dynamicGrid:DynamicSplitPanel.Detail>
- </dynamicGrid:DynamicSplitPanel>
- </UserControl>
|