Click here to Skip to main content
Rate this: bad
good
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 5:09am
Edited 7-Sep-12 18:45pm
v3
Comments
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 OriginalGriff 245
1 Kamal Rocks 184
2 Sergey Alexandrovich Kryukov 175
3 BillWoodruff 173
4 PIEBALDconsult 160
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 7 Sep 2012
Copyright © CodeProject, 1999-2014
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