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
29
30
31
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tango.CodeGeneration
{
public class ProtoProperty : Property
{
public bool Repeated { get; set; }
public String Description { get; set; }
public ProtoProperty()
{
}
public ProtoProperty(String name, String type) : this()
{
Name = name;
Type = type;
}
public ProtoProperty(String name, String type, String description) : this(name, type)
{
Description = description;
}
}
}
pan class="k">namespace Tango.FSE.UI.Views
{
/// <summary>
/// Interaction logic for LayoutView.xaml
/// </summary>
public partial class LayoutView : UserControl, ILayoutView
{
public static LayoutView Instance { get; set; }
private GridLength gridLogsCheckedHeight = new GridLength(300,GridUnitType.Pixel);
private GridLength gridLogsUncheckedHeight;
private LayoutViewVM _vm;
public LayoutView()
{
Instance = this;
InitializeComponent();
Loaded += (_, __) => _vm = DataContext as LayoutViewVM;
gridMask.Visibility = Visibility.Visible;
gridMenu.MouseEnter += GridMenu_MouseEnter;
gridMenu.MouseLeave += GridMenu_MouseLeave;
}
private void GridMenu_MouseLeave(object sender, MouseEventArgs e)
{
_vm.IsMenuOpened = false;
StartPointAnimation(polyTopRight, new Point(70, 0));
StartPointAnimation(polyBottomRight, new Point(70, 300));
}
private void GridMenu_MouseEnter(object sender, MouseEventArgs e)
{
_vm.IsMenuOpened = true;
StartPointAnimation(polyTopRight, new Point(300, 0));
StartPointAnimation(polyBottomRight, new Point(300, 400));
}
private void StartPointAnimation(LineSegment segment, Point to)
{
PointAnimation ani = new PointAnimation();
ani.Duration = TimeSpan.FromSeconds(0.2);
ani.To = to;
segment.BeginAnimation(LineSegment.PointProperty, ani);
}
private void OnLogsChecked(object sender, RoutedEventArgs e)
{
gridLogsUncheckedHeight = logsRowDefinition.Height;
logsRowDefinition.Height = gridLogsCheckedHeight;
logsRowDefinition.MinHeight = 200;
gridLogsSplitter.Visibility = Visibility.Visible;
}
private void OnLogsUnChecked(object sender, RoutedEventArgs e)
{
gridLogsCheckedHeight = logsRowDefinition.Height;
logsRowDefinition.MinHeight = 30;
logsRowDefinition.Height = gridLogsUncheckedHeight;
gridLogsSplitter.Visibility = Visibility.Collapsed;
}
private void BtnDetachLogViewer_Click(object sender, RoutedEventArgs e)
{
chkLogsViewer.IsChecked = false;
}
}
}
|