Blame view
sources/RoboforkApp/Commons/Common.cs
1.07 KB
|
5a5c5239e
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace RoboforkApp.Commons
{
public class Common
{
/// <summary>
/// Get Parent Item of Clicked TreeViewItem
/// </summary>
/// <param name="item">TreeViewItem</param>
/// <returns>Parent of TreeViewItem</returns>
public ItemsControl GetSelectedTreeViewItemParent(TreeViewItem item)
{
DependencyObject parent = VisualTreeHelper.GetParent(item);
while (!(parent is TreeViewItem || parent is TreeView))
{
parent = VisualTreeHelper.GetParent(parent);
}
return parent as ItemsControl;
}
|
|
47aa77821
|
29 30 31 32 33 34 35 36 37 38 |
public double ConvertScaleMap(double distance, double const1000)
{
return distance/ const1000;
}
public double ConvertPointMap(double x, double scale)
{
return x * scale;
}
|
|
5a5c5239e
|
39 40 |
} } |