Wpf - User control or dictionary resource

Sep 24 2010 1:52 AM

Hello,

i am beginner in programming WPF - and sorry for my English :).

I have to question :

1) In the DictionaryResource I can create ContextMenu and later assign this ConterxtMenu to TextBox ( using StaticResource ).

The same I can achieve when I using UserControl ( I create ContextMenu as UserControl and assign to TextBox ).

Do any of these ways is preferred for certain applications such as DictionaryResource apply rather to give the appearance rather than creating the whole ContextMenu?

Are there other ways to share the code?

2) I created such a ContextMenu in ResourceDIctionary (in a separate file.) It has two entries such as "Show", "Close." Signed it to a TextBox in my main window.

And now for ContextMenuStrip in ResourceDictionary for "Show" I assign event - and I want change value in TextBox in main program.

How to connect Resourcy or UserControls with the main program?
Is it possible?

Thanks in advance for your answers.


Answers (2)