This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window1.xaml.vb
49 lines (40 loc) · 1.81 KB
/
Window1.xaml.vb
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
' Developer Express Code Central Example:
' How to zoom an image that is placed in the DXGrid cell
'
' You should create the standard Image control on the window, hide it, and show
' this control when the user clicks the image. The image in a grid cell should be
' wrapped in the button. This allows you easy handle the click event.
'
' You can find sample updates and versions for different programming languages here:
' http://www.devexpress.com/example=E1721
Imports System.Data
Imports System.Data.OleDb
Imports System.Windows
Imports System.Windows.Input
Imports DevExpress.Xpf.Grid
Namespace WpfApplication1
''' <summary>
''' Interaction logic for Window1.xaml
''' </summary>
Partial Public Class Window1
Inherits Window
Private oleDbDataAdapter As OleDbDataAdapter
Public Shared ReadOnly ShowImage As New RoutedCommand("ShowImage", GetType(Window1))
Private Sub image_MouseLeave(ByVal sender As Object, ByVal e As MouseEventArgs)
image.Visibility = Visibility.Hidden
image.DataContext = Nothing
End Sub
Private Sub OnShowImage(ByVal sender As Object, ByVal e As ExecutedRoutedEventArgs)
Dim rowHandle As Integer = RowData.GetRowData(DirectCast(e.OriginalSource, DependencyObject)).RowHandle.Value
image.DataContext = gridControl1.GetCellValue(rowHandle, "Picture")
image.Visibility = Visibility.Visible
image.Width = 700
image.Height = 700
End Sub
Public Sub New()
InitializeComponent()
gridControl1.ItemsSource = (New NwindDataSetTableAdapters.CategoriesTableAdapter()).GetData()
CommandBindings.Add(New CommandBinding(ShowImage, New ExecutedRoutedEventHandler(AddressOf OnShowImage)))
End Sub
End Class
End Namespace