Example #1
0
        private NodeReorderService GetReorderSettersService()
        {
            var reorderService = new NodeReorderService();
            reorderService.ParentNodeNames.Add(new NameSelector("DataTrigger", null));
            reorderService.ParentNodeNames.Add(new NameSelector("MultiDataTrigger", null));
            reorderService.ParentNodeNames.Add(new NameSelector("MultiTrigger", null));
            reorderService.ParentNodeNames.Add(new NameSelector("Style", null));
            reorderService.ParentNodeNames.Add(new NameSelector("Trigger", null));
            reorderService.ChildNodeNames.Add(new NameSelector("Setter", "http://schemas.microsoft.com/winfx/2006/xaml/presentation"));

            switch (this.Options.ReorderSetters)
            {
                case ReorderSettersBy.None:
                    reorderService.IsEnabled = false;
                    break;
                case ReorderSettersBy.Property:
                    reorderService.SortByAttributes.Add(new SortBy("Property", null, false));
                    break;
                case ReorderSettersBy.TargetName:
                    reorderService.SortByAttributes.Add(new SortBy("TargetName", null, false));
                    break;
                case ReorderSettersBy.TargetNameThenProperty:
                    reorderService.SortByAttributes.Add(new SortBy("TargetName", null, false));
                    reorderService.SortByAttributes.Add(new SortBy("Property", null, false));
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
            return reorderService;
        }
Example #2
0
 private NodeReorderService GetReorderGridChildrenService()
 {
     var reorderService = new NodeReorderService { IsEnabled = this.Options.ReorderGridChildren };
     reorderService.ParentNodeNames.Add(new NameSelector("Grid", null));
     reorderService.ChildNodeNames.Add(new NameSelector(null, null));
     reorderService.SortByAttributes.Add(new SortBy("Grid.Row", null, true));
     reorderService.SortByAttributes.Add(new SortBy("Grid.Column", null, true));
     return reorderService;
 }
Example #3
0
 private NodeReorderService GetReorderCanvasChildrenService()
 {
     var reorderService = new NodeReorderService { IsEnabled = this.Options.ReorderCanvasChildren };
     reorderService.ParentNodeNames.Add(new NameSelector("Canvas", null));
     reorderService.ChildNodeNames.Add(new NameSelector(null, null));
     reorderService.SortByAttributes.Add(new SortBy("Canvas.Left", null, true));
     reorderService.SortByAttributes.Add(new SortBy("Canvas.Top", null, true));
     reorderService.SortByAttributes.Add(new SortBy("Canvas.Right", null, true));
     reorderService.SortByAttributes.Add(new SortBy("Canvas.Bottom", null, true));
     return reorderService;
 }