我的XAML文件变得很长,难以维护。我想知道是否有一种类似于重构的方法可以使用?
这里是一个简单的例子:
<Window x:Class="RefactorXAML.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<StackPanel>
<Button>New</Button>
<Button>Open</Button>
</StackPanel>
</Grid>
</Window>
我该如何重构
Stackpanel
部分并编写类似这样的内容?<Window x:Class="RefactorXAML.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
// Refactored Markup
</Grid>
</Window>