Click here to Skip to main content
15,917,859 members
Home / Discussions / C#
   

C#

 
AnswerRe: win7,sc delete, windows servis,process start Pin
Not Active30-Sep-10 3:54
mentorNot Active30-Sep-10 3:54 
GeneralRe: win7,sc delete, windows servis,process start Pin
tomorrow_ft30-Sep-10 3:58
tomorrow_ft30-Sep-10 3:58 
AnswerRe: win7,sc delete, windows servis,process start Pin
Bernhard Hiller30-Sep-10 4:18
Bernhard Hiller30-Sep-10 4:18 
GeneralRe: win7,sc delete, windows servis,process start Pin
tomorrow_ft30-Sep-10 4:21
tomorrow_ft30-Sep-10 4:21 
GeneralRe: win7,sc delete, windows servis,process start Pin
Dave Kreskowiak30-Sep-10 5:33
mveDave Kreskowiak30-Sep-10 5:33 
GeneralRe: win7,sc delete, windows servis,process start Pin
Sunil G 31-Oct-10 18:35
Sunil G 31-Oct-10 18:35 
GeneralRe: win7,sc delete, windows servis,process start Pin
Dave Kreskowiak1-Oct-10 18:37
mveDave Kreskowiak1-Oct-10 18:37 
QuestionUsing C++ class in C# Pin
Nematjon Rahmanov30-Sep-10 3:36
Nematjon Rahmanov30-Sep-10 3:36 
AnswerRe: Using C++ class in C# Pin
Not Active30-Sep-10 3:51
mentorNot Active30-Sep-10 3:51 
QuestionRe: Using C++ class in C# Pin
Nematjon Rahmanov30-Sep-10 3:57
Nematjon Rahmanov30-Sep-10 3:57 
AnswerRe: Using C++ class in C# Pin
Saksida Bojan30-Sep-10 6:54
Saksida Bojan30-Sep-10 6:54 
GeneralRe: Using C++ class in C# [modified] Pin
Ziad Elmalki30-Sep-10 23:04
Ziad Elmalki30-Sep-10 23:04 
AnswerRe: Using C++ class in C# Pin
cepi691-Oct-10 5:08
cepi691-Oct-10 5:08 
QuestionActive directory permissions management Pin
allstarmisho30-Sep-10 1:44
allstarmisho30-Sep-10 1:44 
AnswerRe: Active directory permissions management Pin
Eddy Vluggen30-Sep-10 6:29
professionalEddy Vluggen30-Sep-10 6:29 
QuestionHow to compare the image in datagridviewImage column Pin
NarVish30-Sep-10 0:31
NarVish30-Sep-10 0:31 
AnswerRe: How to compare the image in datagridviewImage column Pin
Henry Minute30-Sep-10 1:51
Henry Minute30-Sep-10 1:51 
GeneralRe: How to compare the image in datagridviewImage column Pin
NarVish30-Sep-10 18:56
NarVish30-Sep-10 18:56 
GeneralRe: How to compare the image in datagridviewImage column Pin
Henry Minute30-Sep-10 18:57
Henry Minute30-Sep-10 18:57 
QuestionConsole Apps for Assemblyinfo.cs version number update. Pin
123!@#aruk29-Sep-10 18:57
123!@#aruk29-Sep-10 18:57 
AnswerRe: Console Apps for Assemblyinfo.cs version number update. Pin
SeMartens29-Sep-10 20:51
SeMartens29-Sep-10 20:51 
GeneralRe: Console Apps for Assemblyinfo.cs version number update. Pin
123!@#aruk30-Sep-10 20:39
123!@#aruk30-Sep-10 20:39 
AnswerRe: Console Apps for Assemblyinfo.cs version number update. Pin
Pete O'Hanlon29-Sep-10 21:54
mvePete O'Hanlon29-Sep-10 21:54 
AnswerRe: Console Apps for Assemblyinfo.cs version number update. Pin
PIEBALDconsult30-Sep-10 3:26
mvePIEBALDconsult30-Sep-10 3:26 
QuestionWPF MVVM Navigation Pin
eddieangel29-Sep-10 11:55
eddieangel29-Sep-10 11:55 
I am using a composition of some different code samples to try to work with a WPF (MVVM) application. I started with Josh Smith's multiple view workspace model as below (pertinent snippet)

#region workspaces

      public ObservableCollection<WorkspaceViewModel> Workspaces
      {
          get
          {
              if (_workspaces == null)
              {
                  _workspaces = new ObservableCollection<WorkspaceViewModel>();
                  _workspaces.CollectionChanged += OnWorkspacesChanged;
              }
              return _workspaces;
          }
      }

      private void OnWorkspacesChanged(object sender, NotifyCollectionChangedEventArgs e)
      {
          if (e.NewItems != null && e.NewItems.Count != 0)
              foreach (WorkspaceViewModel workspace in e.NewItems)
                  workspace.RequestClose += OnWorkspaceRequestClose;

          if (e.OldItems != null && e.OldItems.Count != 0)
              foreach (WorkspaceViewModel workspace in e.OldItems)
                  workspace.RequestClose -= OnWorkspaceRequestClose;
      }

      private void OnWorkspaceRequestClose(Object sender, EventArgs e)
      {
          var workspace = sender as WorkspaceViewModel;
          if (workspace != null)
          {
              workspace.Dispose();
              Workspaces.Remove(workspace);
          }
      }

      #endregion

      #region private helpers

      private void DisplayAllFoo()
      {
          var workspace =
              Workspaces.FirstOrDefault(vm => vm is AllFooViewModel)
              as AllFooViewModel;

          if (workspace == null)
          {
              workspace = new AllFooViewModel();
              Workspaces.Add(workspace);
          }

          SetActiveWorkspace(workspace);
      }

      private static void DisplayFoo()
      {
      }

      public void SetActiveWorkspace(WorkspaceViewModel workspace)
      {
          Debug.Assert(Workspaces.Contains(workspace));

          var collectionView = CollectionViewSource.GetDefaultView(Workspaces);
          if (collectionView != null)
              collectionView.MoveCurrentTo(workspace);
      }

      #endregion


So it is easy enough to work with that, XAML code produces a list of commands which point to the voids above. I wanted to use a treeview navigation structure so I could categorize my navigation commands into categories. I used Josh Smith's (PS Thanks Josh Smith!) WPF MVVM Treeview to make a viewmodel for my categories and navigation items and everything is good there. My issue is this, the navigation commands for each navigation item are on the NavigationCommand viewModel, while the workspace and setactive workspace commands are on the mainWindowViewModel. How do I make this work? How can I call the SetActiveWorkSpace command from my NavCommand viewModel?

Sorry for the mess, --EA

P.S. I do lack a lot of fundamental understanding of WPF, just trying to get a foothold in it.

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.