Click here to Skip to main content
12,700,256 members (36,655 online)

Silverlight / WPF

 
AnswerRe: beginner : binding ListBox Pin
Pete O'Hanlon26-Sep-12 5:26
protectorPete O'Hanlon26-Sep-12 5:26 
GeneralRe: beginner : binding ListBox Pin
dominioYP26-Sep-12 6:41
memberdominioYP26-Sep-12 6:41 
GeneralRe: beginner : binding ListBox Pin
dominioYP28-Sep-12 6:38
memberdominioYP28-Sep-12 6:38 
Questionbeginner : listView, add scrollBar Pin
dominioYP26-Sep-12 4:50
memberdominioYP26-Sep-12 4:50 
QuestionTrying to set focus on DataGrid with DataGridTemplateColumn Pin
abollmeyer23-Sep-12 4:44
memberabollmeyer23-Sep-12 4:44 
AnswerRe: Trying to set focus on DataGrid with DataGridTemplateColumn Pin
abollmeyer24-Sep-12 15:13
memberabollmeyer24-Sep-12 15:13 
QuestionOn ContextMenu MouseLeave Pin
Kenneth Haugland21-Sep-12 4:46
memberKenneth Haugland21-Sep-12 4:46 
AnswerRe: On ContextMenu MouseLeave Pin
Kenneth Haugland21-Sep-12 14:42
memberKenneth Haugland21-Sep-12 14:42 
Ok, I nearly sovled this myself, though its not the ideal solution:
If Mouse.RightButton = MouseButtonState.Pressed Then
                If TypeOf (selectedElement) Is CustomElement Then
                    Dim ga As CustomLine = DirectCast(selectedElement, CustomElement)
                    Dim contextmenu As New ContextMenu()

                    Dim bord As New StackPanel
                    Dim mi As New MenuItem()
                    Dim mia As New MenuItem()
                    mi.Header = ("Item 1")
                    mia.Header = ("Item 2")

                    bord.Children.Add(mi)
                    bord.Children.Add(mia)

                    AddHandler bord.MouseLeave, AddressOf menuitem1_leave

                    contextmenu.Items.Add(bord)
                    contextmenu.IsOpen = True
                    ga.ContextMenu = (contextmenu)
                End If
            End If

with the mouse leave sub:
Private Sub menuitem1_leave(ByVal sender As Object, ByVal e As Input.MouseEventArgs)
     Dim dep As DependencyObject = DirectCast(e.OriginalSource, DependencyObject)

     'Stepping through the visual tree
     While (dep IsNot Nothing) AndAlso Not (TypeOf dep Is ContextMenu)
         dep = VisualTreeHelper.GetParent(dep)
     End While

     If dep Is Nothing Then
         Exit Sub
     End If

     DirectCast(dep, ContextMenu).IsOpen = False
 End Sub

Problem is that the items are messed up inside the ContextMenu, so it looks wierd. So the next question is does anybod have any ideas on how to do this properly?
QuestionWPF DataGrid Not SHowing Any Data Pin
Kevin Marois20-Sep-12 12:30
memberKevin Marois20-Sep-12 12:30 
AnswerRe: WPF DataGrid Not SHowing Any Data Pin
Kenneth Haugland20-Sep-12 12:47
memberKenneth Haugland20-Sep-12 12:47 
GeneralRe: WPF DataGrid Not SHowing Any Data Pin
Pete O'Hanlon20-Sep-12 12:59
protectorPete O'Hanlon20-Sep-12 12:59 
GeneralRe: WPF DataGrid Not SHowing Any Data Pin
Kenneth Haugland20-Sep-12 13:10
memberKenneth Haugland20-Sep-12 13:10 
AnswerRe: WPF DataGrid Not SHowing Any Data Pin
Pete O'Hanlon20-Sep-12 13:01
protectorPete O'Hanlon20-Sep-12 13:01 
GeneralRe: WPF DataGrid Not SHowing Any Data Pin
Kevin Marois20-Sep-12 14:23
memberKevin Marois20-Sep-12 14:23 
GeneralRe: WPF DataGrid Not SHowing Any Data Pin
Pete O'Hanlon20-Sep-12 14:58
protectorPete O'Hanlon20-Sep-12 14:58 
Questionstackedbarseries chart: change the axes display Pin
ashlyacht19-Sep-12 11:03
memberashlyacht19-Sep-12 11:03 
Question[XML] XML binding Pin
Jayme6519-Sep-12 8:10
memberJayme6519-Sep-12 8:10 
Questionplay streaming videos from internet in wpf Pin
sudeep kushwaha17-Sep-12 19:31
membersudeep kushwaha17-Sep-12 19:31 
AnswerRe: play streaming videos from internet in wpf Pin
Mycroft Holmes17-Sep-12 21:05
memberMycroft Holmes17-Sep-12 21:05 
QuestionItemsControl with Horizontal orientation Pin
Kenneth Haugland17-Sep-12 8:25
memberKenneth Haugland17-Sep-12 8:25 
AnswerRe: ItemsControl with Horizontal orientation Pin
Abhinav S17-Sep-12 8:49
mvpAbhinav S17-Sep-12 8:49 
AnswerRe: ItemsControl with Horizontal orientation Pin
Kenneth Haugland17-Sep-12 9:04
memberKenneth Haugland17-Sep-12 9:04 
GeneralRe: ItemsControl with Horizontal orientation Pin
Abhinav S17-Sep-12 18:25
mvpAbhinav S17-Sep-12 18:25 
GeneralRe: ItemsControl with Horizontal orientation Pin
Kenneth Haugland17-Sep-12 21:24
memberKenneth Haugland17-Sep-12 21:24 
AnswerRe: ItemsControl with Horizontal orientation Pin
Kenneth Haugland17-Sep-12 10:35
memberKenneth Haugland17-Sep-12 10:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 20 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid