Click here to Skip to main content
15,904,153 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Installed Silverlight 3 Tools, Getting Exception Pin
#realJSOP14-Apr-10 23:42
professional#realJSOP14-Apr-10 23:42 
GeneralRe: Installed Silverlight 3 Tools, Getting Exception Pin
Abhinav S15-Apr-10 18:22
Abhinav S15-Apr-10 18:22 
GeneralRe: Installed Silverlight 3 Tools, Getting Exception Pin
#realJSOP16-Apr-10 1:30
professional#realJSOP16-Apr-10 1:30 
QuestionSilverlight 3 MediaElement - Mac Progressive Download problem with playing full movies Pin
JustinSays14-Apr-10 1:21
JustinSays14-Apr-10 1:21 
QuestionHow to display another user control Pin
#realJSOP13-Apr-10 8:57
professional#realJSOP13-Apr-10 8:57 
AnswerRe: How to display another user control [modified] Pin
Abhinav S13-Apr-10 18:13
Abhinav S13-Apr-10 18:13 
AnswerRe: How to display another user control Pin
Frank W. Wu12-Oct-10 4:52
Frank W. Wu12-Oct-10 4:52 
QuestionTreeViewItem and opening a modal dialog from the contextmenu (Properties) [modified] Pin
Diving Flo13-Apr-10 3:30
Diving Flo13-Apr-10 3:30 
Hi there!

In our application (we use MVVM pattern) we have a treeview that uses a ViewModel as DataContext. Each node then has its own ViewModel. Depending on the type there are different HierarchicalDataTemplates. In other words we have a ViewModel hierarchy. This works without any problems.

Now I implemented a context menu that should enable the user to open a modal dialog that shows some properties of the ViewModel (actually of the underlying business object). As it is not easy to open a modal dialog with MVVM pattern, I used the WPF Quick Recipes - Dialogs[^].

To abbreviate things, I need to place the following code snippet within my TreeViewItem. This is responsible to show the modal dialog when setting the ModalDialogViewModel property. I need to put this into the treeviewitem in order to get the correct DataContext from the ViewModel of the item.

<FrameworkElement DataContext="{Binding Path=ModalDialogViewModel}">
    <behaviour:DialogBehavior.DisplayModal>True</behaviour:DialogBehavior.DisplayModal>
</FrameworkElement>


Where and how can I place this in my TreeViewItem. ControlTemplate? DataTemplate?

Hopefully you understand what I mean. Otherwise tell me, what's not clear!

Thanks in advance!
Florian
modified on Tuesday, April 13, 2010 9:53 AM

GeneralRe: TreeViewItem and opening a modal dialog from the contextmenu (Properties) Pin
Diving Flo13-Apr-10 20:28
Diving Flo13-Apr-10 20:28 
AnswerRe: TreeViewItem and opening a modal dialog from the contextmenu (Properties) Pin
Diving Flo14-Apr-10 23:23
Diving Flo14-Apr-10 23:23 
QuestionOpen window in New browser window Pin
Tripathi Swati13-Apr-10 0:38
Tripathi Swati13-Apr-10 0:38 
AnswerRe: Open window in New browser window Pin
Abhinav S13-Apr-10 5:52
Abhinav S13-Apr-10 5:52 
GeneralRe: Open window in New browser window Pin
Tripathi Swati15-Apr-10 21:00
Tripathi Swati15-Apr-10 21:00 
QuestionPhilosophical question on MVVM lookups and practical one on entity fields.... Pin
RichardGrimmer12-Apr-10 23:57
RichardGrimmer12-Apr-10 23:57 
AnswerRe: Philosophical question on MVVM lookups and practical one on entity fields.... Pin
Abhinav S13-Apr-10 5:51
Abhinav S13-Apr-10 5:51 
GeneralRe: Philosophical question on MVVM lookups and practical one on entity fields.... Pin
RichardGrimmer13-Apr-10 9:05
RichardGrimmer13-Apr-10 9:05 
GeneralRe: Philosophical question on MVVM lookups and practical one on entity fields.... Pin
Abhinav S13-Apr-10 18:31
Abhinav S13-Apr-10 18:31 
GeneralRe: Philosophical question on MVVM lookups and practical one on entity fields.... Pin
RichardGrimmer13-Apr-10 21:30
RichardGrimmer13-Apr-10 21:30 
QuestionSelecting an item as per value in combobox in wpf Pin
dashingsidds12-Apr-10 22:50
dashingsidds12-Apr-10 22:50 
AnswerRe: Selecting an item as per value in combobox in wpf Pin
Arun Jacob12-Apr-10 22:58
Arun Jacob12-Apr-10 22:58 
GeneralRe: Selecting an item as per value in combobox in wpf [modified] Pin
dashingsidds12-Apr-10 23:26
dashingsidds12-Apr-10 23:26 
AnswerRe: Selecting an item as per value in combobox in wpf Pin
Arun Jacob12-Apr-10 23:30
Arun Jacob12-Apr-10 23:30 
GeneralRe: Selecting an item as per value in combobox in wpf Pin
dashingsidds12-Apr-10 23:41
dashingsidds12-Apr-10 23:41 
GeneralRe: Selecting an item as per value in combobox in wpf Pin
Arun Jacob12-Apr-10 23:47
Arun Jacob12-Apr-10 23:47 
AnswerRe: Selecting an item as per value in combobox in wpf Pin
Sunil Scaria12-Apr-10 23:15
Sunil Scaria12-Apr-10 23:15 

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.