-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPresentWindow.xaml.cs
60 lines (51 loc) · 1.95 KB
/
PresentWindow.xaml.cs
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
namespace SnippetManager
{
using System.Windows;
using ViewModels;
using System.Windows.Controls;
using MahApps.Metro.Controls;
using Models;
/// <summary>
/// Interaction logic for PresentWindow.xaml
/// </summary>
public partial class PresentWindow : MetroWindow
{
/// <summary>
/// Access to the ViewModel.
/// </summary>
public MainViewModel MainViewModel => DataContext as MainViewModel;
public PresentWindow()
{
InitializeComponent();
//position and margin
int marginTop = 25;
int marginBottom = 25;
PresentWindowWindow.Height = SystemParameters.PrimaryScreenHeight - marginTop - marginBottom;
PresentWindowWindow.Top = marginTop;
PresentWindowWindow.Left = SystemParameters.PrimaryScreenWidth - PresentWindowWindow.Width;
//Disable ScrollBars
this.LstSnippets.SetValue(ScrollViewer.HorizontalScrollBarVisibilityProperty, ScrollBarVisibility.Disabled);
this.LstSnippets.SetValue(ScrollViewer.VerticalScrollBarVisibilityProperty, ScrollBarVisibility.Disabled);
}
private void PresentWindowWindow_Closed(object sender, System.EventArgs e)
{
this.MainViewModel.IsInPresentMode = false;
}
private void MoveButton(object sender, RoutedEventArgs e)
{
if (this.Left == 0)
this.Left = SystemParameters.PrimaryScreenWidth - this.Width;
else
this.Left = 0;
}
private void CloseButton(object sender, RoutedEventArgs e)
{
this.Close();
}
private void lstSnippets_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
var ewl = new EditWindowLogic(this.MainViewModel, this.LstSnippets);
ewl.OpeningRequest(this.MainViewModel.SelectedSnippet);
}
}
}