|
0
|
1 |
using System; |
|
|
2 |
using System.Net; |
|
|
3 |
using System.Windows; |
|
|
4 |
using System.Windows.Controls; |
|
|
5 |
using System.Windows.Documents; |
|
|
6 |
using System.Windows.Ink; |
|
|
7 |
using System.Windows.Input; |
|
|
8 |
using System.Windows.Media; |
|
|
9 |
using System.Windows.Media.Animation; |
|
|
10 |
using System.Windows.Shapes; |
|
|
11 |
using Iri.Modernisation.BaseMVVM.Commands; |
|
|
12 |
using Iri.Modernisation.Controls.ViewModel; |
|
|
13 |
namespace Iri.Modernisation.Controls.View |
|
|
14 |
{ |
|
|
15 |
public abstract partial class MenuableUserControl : UserControl |
|
|
16 |
{ |
|
|
17 |
public MenuableUserControl() |
|
|
18 |
{ |
|
|
19 |
MouseEnter += new MouseEventHandler(MenuableUserControl_MouseEnter); |
|
|
20 |
MouseLeave += new MouseEventHandler(MenuableUserControl_MouseLeave); |
|
29
|
21 |
MouseRightButtonDown += new MouseButtonEventHandler(MenuableUserControl_MouseRightButtonDown); |
|
|
22 |
|
|
|
23 |
MouseRightButtonUp += new MouseButtonEventHandler(MenuableUserControl_MouseRightButtonUp); |
|
0
|
24 |
} |
|
|
25 |
|
|
|
26 |
void MenuableUserControl_MouseLeave(object sender, MouseEventArgs e) |
|
|
27 |
{ |
|
|
28 |
((MenuableViewModel)base.DataContext).MenuableUserControl_MouseLeave(sender, e); |
|
|
29 |
} |
|
|
30 |
|
|
|
31 |
void MenuableUserControl_MouseEnter(object sender, MouseEventArgs e) |
|
|
32 |
{ |
|
|
33 |
((MenuableViewModel)base.DataContext).MenuableUserControl_MouseEnter(sender, e); |
|
|
34 |
|
|
|
35 |
} |
|
|
36 |
|
|
29
|
37 |
void MenuableUserControl_MouseRightButtonUp(object sender, MouseButtonEventArgs e) |
|
0
|
38 |
{ |
|
29
|
39 |
((MenuableViewModel)base.DataContext).DisactiveContextualMenu(sender, e); |
|
0
|
40 |
} |
|
|
41 |
|
|
29
|
42 |
void MenuableUserControl_MouseRightButtonDown(object sender, MouseButtonEventArgs e) |
|
0
|
43 |
{ |
|
29
|
44 |
if (this.IsEnabled) |
|
|
45 |
{ |
|
|
46 |
e.Handled = true; |
|
|
47 |
((MenuableViewModel)base.DataContext).ActiveContextualMenu(sender, e); |
|
|
48 |
} |
|
0
|
49 |
} |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
} |
|
|
54 |
} |