@ -46,6 +46,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
@@ -46,6 +46,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
void Click_BringToFront ( object sender , RoutedEventArgs e )
{
if ( ( designItem . ParentProperty = = null ) | | ! designItem . ParentProperty . IsCollection )
return ;
var collection = this . designItem . ParentProperty . CollectionElements ;
collection . Remove ( this . designItem ) ;
collection . Add ( this . designItem ) ;
@ -53,6 +56,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
@@ -53,6 +56,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
void Click_SendToBack ( object sender , RoutedEventArgs e )
{
if ( ( designItem . ParentProperty = = null ) | | ! designItem . ParentProperty . IsCollection )
return ;
var collection = this . designItem . ParentProperty . CollectionElements ;
collection . Remove ( this . designItem ) ;
collection . Insert ( 0 , this . designItem ) ;
@ -60,14 +66,20 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
@@ -60,14 +66,20 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
void Click_Backward ( object sender , RoutedEventArgs e )
{
if ( ( designItem . ParentProperty = = null ) | | ! designItem . ParentProperty . IsCollection )
return ;
var collection = this . designItem . ParentProperty . CollectionElements ;
var idx = collection . IndexOf ( this . designItem ) ;
collection . RemoveAt ( idx ) ;
collection . Insert ( ( - - idx < 0 ? 0 : idx ) , this . designItem ) ;
collection . Insert ( ( - - idx < 0 ? 0 : idx ) , this . designItem ) ;
}
void Click_Forward ( object sender , RoutedEventArgs e )
{
if ( ( designItem . ParentProperty = = null ) | | ! designItem . ParentProperty . IsCollection )
return ;
var collection = this . designItem . ParentProperty . CollectionElements ;
var idx = collection . IndexOf ( this . designItem ) ;
collection . RemoveAt ( idx ) ;