{
"_id" : ObjectId("55d8a835363ffb2157589145"),
"like" : [
{
"tlid" : 111,
"tlikers" : [
"amudibarongo@gmail.com",
"harunabarongo@gmail.com"
]
},
{
"tlid" : 112,
"tlikers" : [
"amudibarongo@gmail.com",
"harunabarongo@gmail.com"
]
},
{
"tlid" : 113,
"tlikers" : [
"amudibarongo@gmail.com",
"harunabarongo@gmail.com",
"jumabarongo@gmial.com"
]
}
],
"tlikeid" : "amudibarongo@gmail.com"
}
我想在按钮Click上拖动Grid Splitter。我尝试过Double Animation.StoryBoard,它可以在网格上运行但不适用于网格分割器。
答案 0 :(得分:5)
您必须调整网格列的大小,而不是网格分割器。
private void BtnLeft_Click(object sender, RoutedEventArgs e)
{
MyGrid.ColumnDefinitions[0].Width = new GridLength(100);
}
<Grid x:Name="MyGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="Left" Background="LightBlue" />
<GridSplitter Grid.Column="1" Width="10" ResizeBehavior="PreviousAndNext" />
<Label Content="Right" Background="LightGoldenrodYellow" Grid.Column="2" />
<Button Content="Left" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnLeft_Click" />
</Grid>