using KGIS.Framework.Utils;
using System;
using System.Windows;
using System.Windows.Media;
namespace Kingo.Plugin.MapView.Views.MeasurementUi
{
///
/// MeasurementUi.xaml 的交互逻辑
///
public partial class MeasurementUi : BaseWindow
{
///
/// 委托类型(通过委托来显示不同的测量页面)
///
public Action ActionsUpda;
public MeasurementUi()
{
InitializeComponent();
}
///
/// 测量长度按钮
///
///
///
private void Btn_length_Click(object sender, RoutedEventArgs e)
{
Btn_length.Background = new SolidColorBrush(Colors.Gray);
Btn_Area.Background = new SolidColorBrush(Colors.White);
btn_ComputationalGeo.Background = new SolidColorBrush(Colors.White);
if (Grid_Area.Visibility != Visibility.Collapsed)
{
this.Grid_Area.Visibility = Visibility.Collapsed;
}
if (this.Grid_Length.Visibility != Visibility.Visible)
{
this.Grid_Length.Visibility = Visibility.Visible;
}
ActionsUpda(0);
}
///
/// 测量面积按钮
///
///
///
private void Btn_Area_Click(object sender, RoutedEventArgs e)
{
Btn_Area.Background = new SolidColorBrush(Colors.Gray);
Btn_length.Background = new SolidColorBrush(Colors.White);
btn_ComputationalGeo.Background = new SolidColorBrush(Colors.White);
this.Grid_Area.Visibility = Visibility.Visible;
this.Grid_Length.Visibility = Visibility.Collapsed;
ActionsUpda(1);
}
///
/// 测量图形
///
///
///
private void btn_ComputationalGeo_Click(object sender, RoutedEventArgs e)
{
btn_ComputationalGeo.Background = new SolidColorBrush(Colors.Gray);
Btn_Area.Background = new SolidColorBrush(Colors.White);
Btn_length.Background = new SolidColorBrush(Colors.White);
ActionsUpda(2);
}
///
/// 窗体关闭事件
///
///
///
private void BaseWindow_Closed(object sender, EventArgs e)
{
ActionsUpda(3);
this.Close();
}
}
}