|
0
|
1 |
using System; |
|
|
2 |
using System.Windows; |
|
|
3 |
using System.Windows.Controls; |
|
|
4 |
using System.Windows.Documents; |
|
|
5 |
using System.Windows.Ink; |
|
|
6 |
using System.Windows.Input; |
|
|
7 |
using System.Windows.Media; |
|
|
8 |
using System.Windows.Media.Animation; |
|
|
9 |
using System.Windows.Shapes; |
|
|
10 |
|
|
|
11 |
namespace Iri.Modernisation.Controls.View |
|
|
12 |
{ |
|
|
13 |
public partial class ClickMenuItem : ContentControl |
|
|
14 |
|
|
|
15 |
{ |
|
|
16 |
/* |
|
|
17 |
public ImageSource ImageSource { |
|
|
18 |
get { return imgItem.Source; } |
|
|
19 |
set { imgItem.Source = value; } |
|
|
20 |
} |
|
|
21 |
*/ |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
public String Title { get; set; } |
|
|
25 |
|
|
|
26 |
public event EventHandler<ClickMenuItemHooverEventArgs> ClickMenuItemHooverSelected; |
|
|
27 |
public event EventHandler<ClickMenuItemSelectedEventArgs> ClickMenuItemSelected; |
|
|
28 |
public ClickMenuItem() |
|
|
29 |
{ |
|
|
30 |
// Required to initialize variables |
|
|
31 |
InitializeComponent(); |
|
|
32 |
} |
|
|
33 |
|
|
|
34 |
private void MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) |
|
|
35 |
{ |
|
|
36 |
OnEnter(); |
|
|
37 |
|
|
|
38 |
} |
|
|
39 |
|
|
|
40 |
private void OnEnter() |
|
|
41 |
{ |
|
|
42 |
if (ClickMenuItemHooverSelected != null) |
|
|
43 |
{ |
|
|
44 |
this.ClickMenuItemHooverSelected(this, new ClickMenuItemHooverEventArgs()); |
|
|
45 |
} |
|
|
46 |
} |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
private void UserControl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) |
|
|
51 |
{ |
|
|
52 |
if (ClickMenuItemSelected != null) |
|
|
53 |
{ |
|
|
54 |
this.ClickMenuItemSelected(this, new ClickMenuItemSelectedEventArgs()); |
|
|
55 |
} |
|
|
56 |
} |
|
|
57 |
|
|
|
58 |
} |
|
|
59 |
public class ClickMenuItemSelectedEventArgs : EventArgs |
|
|
60 |
{ |
|
|
61 |
} |
|
|
62 |
public class ClickMenuItemHooverEventArgs : EventArgs |
|
|
63 |
{ |
|
|
64 |
|
|
|
65 |
public ClickMenuItemHooverEventArgs() |
|
|
66 |
{ |
|
|
67 |
|
|
|
68 |
} |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
} |
|
|
72 |
} |