예제 #1
0
파일: Editor.cs 프로젝트: girish66/REM
        private void InitializeExpander(EditableExpander editableExpander)
        {
            var accessManagerBinding = new Binding();

            accessManagerBinding.Source = this;
            accessManagerBinding.Path   = new PropertyPath(PropertyUtil.ExtractPropertyName(() => AccessControlManager));
            editableExpander.SetBinding(SecureControl.AccessControlManagerProperty, accessManagerBinding);

            if (SaveCommand != null)
            {
                var saveBinding = new Binding();
                saveBinding.Source = this;
                saveBinding.Path   = new PropertyPath(PropertyUtil.ExtractPropertyName(() => SaveCommand));
                editableExpander.SetBinding(EditableExpander.SaveCommandProperty, saveBinding);
            }

            if (CancelCommand != null)
            {
                var cancelBinding = new Binding();
                cancelBinding.Source = this;
                cancelBinding.Path   = new PropertyPath(PropertyUtil.ExtractPropertyName(() => CancelCommand));
                editableExpander.SetBinding(EditableExpander.CancelCommandProperty, cancelBinding);
            }

            if (Expanders.Count() > 1)
            {
                editableExpander.NextCommand = new DelegateCommand <EditableExpander> (ExecuteNextCommand);
            }
        }
예제 #2
0
파일: Editor.cs 프로젝트: girish66/REM
        private void ExecuteNextCommand(EditableExpander editableExpander)
        {
            var index     = Expanders.IndexOf(editableExpander);
            var nextIndex = index + 1;

            if (nextIndex == Expanders.Count)
            {
                nextIndex = 0;
            }
            EditableExpander next;

            while ((next = Expanders[nextIndex]) != editableExpander)
            {
                if (next.CanAccess)
                {
                    next.SetAsNextCommand.Execute(null);
                    break;
                }
                nextIndex++;
                if (nextIndex == Expanders.Count)
                {
                    nextIndex = 0;
                }
            }
        }
예제 #3
0
파일: Editor.cs 프로젝트: girish66/REM
 private void UpdateStartOpened()
 {
     if (StartOpen)
     {
         ExecuteExpandAllCommand();
         if (Expanders != null && Expanders.Count() > 0)
         {
             var expander = Expanders.ElementAt(0);
             expander.SetAsNextCommand.Execute(null);
         }
     }
     else
     {
         ExecuteCollapseAllCommand();
         if (Expanders != null && Expanders.Count() > 0)
         {
             var expander = Expanders.ElementAt(0);
             expander.IsExpanded = true;
         }
     }
 }