예제 #1
0
        public virtual void FunctionClick(ApplicationFunction function)
        {
            UserControlFunctionItem<ApplicationFunction> first =
            openedUserControlCollection.FirstOrDefault(f => f.Data.ID == function.ID);
              if (first != null)
              {
            CurrentUserControl = first;
            return;
              }
              var control = new UserControlFunctionItem<ApplicationFunction>(function.ImageUrl, CloseFunction)
              {
            Header = function.Name,
            Data = function,
            Content = GetContentFromFunction(function),
              };

              var showProgress = control.Content.DataContext as IProgress;
              if (showProgress != null)
              {
            showProgress.StartShowing = s => control.Progress.ShowProgress(string.Format("Loading {0}", function.Name));
            showProgress.StopShowing = () => control.Progress.HideProgress();
              }

              var dataLoad = control.Content as IDataLoad;
              if (dataLoad != null)
              {
            dataLoad.Load();
              }

              openedUserControlCollection.Add(control);
              CurrentUserControl = control;
              NotifyOfPropertyChange(() => OpenedUserControlCollection);
        }
예제 #2
0
        public virtual void FunctionClick(ApplicationFunction function)
        {
            UserControlFunctionItem<ApplicationFunction> first =
            openedUserControlCollection.FirstOrDefault(f => f.Data.ID == function.ID);
              if (first != null)
              {
            CurrentUserControl = first;
            return;
              }
              var control = new UserControlFunctionItem<ApplicationFunction>(function.ImageUrl, CloseFunction)
              {
            Header = function.Name,
            Data = function
              };
              control.Content = GetContentFromFunction(function, control.Progress);

              var dataLoad = control.Content as IDataLoad;
              if (dataLoad != null)
            dataLoad.Load();

              openedUserControlCollection.Add(control);
              CurrentUserControl = control;
              NotifyOfPropertyChange(() => OpenedUserControlCollection);
        }