Click here to Skip to main content
11,716,133 members (87,068 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WPF MVVM
Hi ,

I am building a DLL using WPF -MVVM . I have a custom dialog implemented in this DLL using MVVM. I want to make the View class of this dialog internal to the DLL so that anyone referencing this DLL does not have access to this view class. Is there some way to achieve this ? If I just mark the View class as internal , then the compiler isn't happy and says that partial classes have different visibilities. Am not sure if making both parts of the partial class internal is the correct way since these View classes would need to be called by the WPF runtime.

Any help is appreciated.
Posted 7-Sep-12 4:09am
Edited 7-Sep-12 17:45pm
Kenneth Haugland at 8-Sep-12 14:59pm
I dont think you can. But im not entirely sure..
Thomas Duwe at 10-Sep-12 7:20am
I think this depends on how your view and viewmodel are created and shown.

Say if you have a view factory with some method ShowCustomDialog(args...)
and you instantiate your viewmodel and view and assigning the datacontext of the view manually in this factory method, there shouldn't be a problem (I think).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 683
1 Richard MacCutchan 280
2 Maciej Los 259
3 OriginalGriff 160
4 F-ES Sitecore 135
0 Sergey Alexandrovich Kryukov 1,003
1 Richard MacCutchan 430
2 CHill60 415
3 Maciej Los 399
4 OriginalGriff 385

Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 7 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100