예제 #1
0
        void pthUp_MouseDown(object sender, MouseButtonEventArgs e)
        {
            Grid item = (Grid)((Path)sender).Tag;

            if (item.Children[0] is ILayerProperties)
            {
                ILayerProperties layer = ((ILayerProperties)item.Children[0]);
                int currentIndex       = grdPlaceholder.Children.IndexOf(item);
                if (currentIndex > 0)
                {
                    item.Children.Remove((UIElement)layer);
                    grdPlaceholder.Children.Remove(item);
                    AddListItem(layer, currentIndex - 1);
                    layer.MoveUp();
                }
            }
        }
예제 #2
0
        void cbxLayerType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (cbxLayerType.SelectedIndex)
            {
            case 0:
                LayerProperties = new ClusterLayerProperties(myMap, dashboardHelper, mapControl);
                break;

            case 1:
                LayerProperties = new ChoroplethShapeLayerProperties(myMap, dashboardHelper, mapControl);
                break;

            default:
                LayerProperties = new ClusterLayerProperties(myMap, dashboardHelper, mapControl);
                break;
            }
            LayerProperties.MapGenerated += new EventHandler(layerProperties_MapGenerated);
            LayerProperties.FontColor     = FontColor;
            AddLayerProperties((UserControl)LayerProperties);
        }
예제 #3
0
        public void AddListItem(ILayerProperties item, int index)
        {
            Grid container = new Grid();

            StackPanel stkNavButtons = new StackPanel();

            stkNavButtons.Orientation         = Orientation.Horizontal;
            stkNavButtons.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;

            Path pthUp = (Path)System.Windows.Markup.XamlReader.Parse("<Path xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'  Data=\"M85,30 L85,30 L87.5,25 L90,30 z\" RenderTransformOrigin=\"3.083,-1.417\"/>");

            pthUp.Height = 15;
            pthUp.Width  = 15;
            pthUp.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            pthUp.VerticalAlignment   = System.Windows.VerticalAlignment.Center;
            pthUp.Stretch             = Stretch.Fill;
            pthUp.Fill            = new SolidColorBrush(Color.FromArgb(0x99, 0x5C, 0x90, 0xB2));
            pthUp.StrokeThickness = 0;
            pthUp.Tag             = container;
            pthUp.Cursor          = Cursors.Hand;
            pthUp.ToolTip         = new Label()
            {
                Content = DashboardSharedStrings.GADGET_MAP_LAYER_FORWARD
            };
            pthUp.MouseDown += new MouseButtonEventHandler(pthUp_MouseDown);

            Path pthDown = (Path)System.Windows.Markup.XamlReader.Parse("<Path xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'  Data=\"M85,25 L85,25 L87.5,30 L90,25 z\" RenderTransformOrigin=\"3.083,-1.417\"/>");

            pthDown.Height = 15;
            pthDown.Width  = 15;
            pthDown.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            pthDown.VerticalAlignment   = System.Windows.VerticalAlignment.Center;
            pthDown.Stretch             = Stretch.Fill;
            pthDown.Fill            = new SolidColorBrush(Color.FromArgb(0x99, 0x5C, 0x90, 0xB2));
            pthDown.StrokeThickness = 0;
            pthDown.Tag             = container;
            pthDown.Cursor          = Cursors.Hand;
            pthDown.ToolTip         = new Label()
            {
                Content = DashboardSharedStrings.GADGET_MAP_LAYER_BACK
            };
            pthDown.MouseDown += new MouseButtonEventHandler(pthDown_MouseDown);

            Path pthClose = (Path)System.Windows.Markup.XamlReader.Parse("<Path xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'  Data=\"M85,25 L85,25 L90,30 M90,25 L90,25 L85,30\" RenderTransformOrigin=\"3.083,-1.417\"/>");

            pthClose.Height = 15;
            pthClose.Width  = 15;
            pthClose.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            pthClose.VerticalAlignment   = System.Windows.VerticalAlignment.Center;
            pthClose.Stretch             = Stretch.Fill;
            pthClose.Stroke          = new SolidColorBrush(Color.FromArgb(0x99, 0x5C, 0x90, 0xB2));
            pthClose.StrokeThickness = 2;
            pthClose.Tag             = container;
            pthClose.Cursor          = Cursors.Hand;
            pthClose.ToolTip         = new Label()
            {
                Content = DashboardSharedStrings.GADGET_MAP_LAYER_CLOSE
            };
            pthClose.Margin     = new Thickness(3, 0, 0, 0);
            pthClose.MouseDown += new MouseButtonEventHandler(pthClose_MouseDown);

            stkNavButtons.Children.Add(pthUp);
            stkNavButtons.Children.Add(pthDown);
            stkNavButtons.Children.Add(pthClose);

            item.MakeReadOnly();
            container.Children.Add((UIElement)item);
            container.Children.Add(stkNavButtons);

            grdPlaceholder.Children.Insert(index, container);
            txtLayerCount.Text = grdPlaceholder.Children.Count.ToString();
        }
예제 #4
0
 void cbxLayerType_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     switch (cbxLayerType.SelectedIndex)
     {
         case 0:
             LayerProperties = new ClusterLayerProperties(myMap, dashboardHelper, mapControl);
             break;
         case 1:
             LayerProperties = new ChoroplethLayerProperties(myMap, dashboardHelper, mapControl);
             break;
         default:
             LayerProperties = new ClusterLayerProperties(myMap, dashboardHelper, mapControl);
             break;
     }
     LayerProperties.MapGenerated += new EventHandler(layerProperties_MapGenerated);
     LayerProperties.FontColor = FontColor;
     AddLayerProperties((UserControl)LayerProperties);
 }
예제 #5
0
        public void AddListItem(ILayerProperties item, int index)
        {
            Grid container = new Grid();

            StackPanel stkNavButtons = new StackPanel();
            stkNavButtons.Orientation = Orientation.Horizontal;
            stkNavButtons.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;

            Path pthUp = (Path)System.Windows.Markup.XamlReader.Parse("<Path xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'  Data=\"M85,30 L85,30 L87.5,25 L90,30 z\" RenderTransformOrigin=\"3.083,-1.417\"/>");
            pthUp.Height = 15;
            pthUp.Width = 15;
            pthUp.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            pthUp.VerticalAlignment = System.Windows.VerticalAlignment.Center;
            pthUp.Stretch = Stretch.Fill;
            pthUp.Fill = new SolidColorBrush(Color.FromArgb(0x99, 0x5C, 0x90, 0xB2));
            pthUp.StrokeThickness = 0;
            pthUp.Tag = container;
            pthUp.Cursor = Cursors.Hand;
            pthUp.ToolTip = new Label() { Content = "Bring layer forward" };
            pthUp.MouseDown += new MouseButtonEventHandler(pthUp_MouseDown);

            Path pthDown = (Path)System.Windows.Markup.XamlReader.Parse("<Path xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'  Data=\"M85,25 L85,25 L87.5,30 L90,25 z\" RenderTransformOrigin=\"3.083,-1.417\"/>");
            pthDown.Height = 15;
            pthDown.Width = 15;
            pthDown.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            pthDown.VerticalAlignment = System.Windows.VerticalAlignment.Center;
            pthDown.Stretch = Stretch.Fill;
            pthDown.Fill = new SolidColorBrush(Color.FromArgb(0x99, 0x5C, 0x90, 0xB2));
            pthDown.StrokeThickness = 0;
            pthDown.Tag = container;
            pthDown.Cursor = Cursors.Hand;
            pthDown.ToolTip = new Label() { Content = "Send layer back" };
            pthDown.MouseDown += new MouseButtonEventHandler(pthDown_MouseDown);

            Path pthClose = (Path)System.Windows.Markup.XamlReader.Parse("<Path xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'  Data=\"M85,25 L85,25 L90,30 M90,25 L90,25 L85,30\" RenderTransformOrigin=\"3.083,-1.417\"/>");
            pthClose.Height = 15;
            pthClose.Width = 15;
            pthClose.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            pthClose.VerticalAlignment = System.Windows.VerticalAlignment.Center;
            pthClose.Stretch = Stretch.Fill;
            pthClose.Stroke = new SolidColorBrush(Color.FromArgb(0x99, 0x5C, 0x90, 0xB2));
            pthClose.StrokeThickness = 2;
            pthClose.Tag = container;
            pthClose.Cursor = Cursors.Hand;
            pthClose.ToolTip = new Label() { Content = "Close layer" };
            pthClose.Margin = new Thickness(3, 0, 0, 0);
            pthClose.MouseDown += new MouseButtonEventHandler(pthClose_MouseDown);

            stkNavButtons.Children.Add(pthUp);
            stkNavButtons.Children.Add(pthDown);
            stkNavButtons.Children.Add(pthClose);

            item.MakeReadOnly();
            container.Children.Add((UIElement)item);
            container.Children.Add(stkNavButtons);

            grdPlaceholder.Children.Insert(index, container);
            txtLayerCount.Text = grdPlaceholder.Children.Count.ToString();
        }