我在Laravel中编写API,我试图从两个表private void MyEllipse_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
INotifyPropertyChanged inpc = MyEllipse.DataContext as INotifyPropertyChanged;
if (inpc != null)
WeakEventManager<INotifyPropertyChanged, PropertyChangedEventArgs>.AddHandler(inpc, nameof(INotifyPropertyChanged.PropertyChanged), OnChanged);
}
private PropertyInfo _pi;
private void OnChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "Anim")
{
_pi = _pi ?? sender.GetType().GetProperty(e.PropertyName);
string anim = _pi?.GetValue(sender) as string;
switch (anim)
{
case "Left":
myTransform.BeginAnimation(TranslateTransform.XProperty, new DoubleAnimation() { To = 100.0, Duration = TimeSpan.FromSeconds(1) });
break;
case "Right":
myTransform.BeginAnimation(TranslateTransform.XProperty, new DoubleAnimation() { To = 200.0, Duration = TimeSpan.FromSeconds(1) });
break;
}
}
}
和<Viewbox xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Canvas Width="350" Height="150" Background="CornflowerBlue">
<Ellipse x:Name="MyEllipse" Width="20" Height="20" Fill="Red"
DataContextChanged="MyEllipse_DataContextChanged">
<Ellipse.RenderTransform>
<TranslateTransform x:Name="myTransform" X="50" Y="50" />
</Ellipse.RenderTransform>
</Ellipse>
<Button x:Name="btnLeft" Content="Left" Command="{Binding AnimCommand}" CommandParameter="Left" Canvas.Left="100" Canvas.Top="100" Width="32" Height="24" />
<Button x:Name="btnRight" Content="Right" Command="{Binding AnimCommand}" CommandParameter="Right" Canvas.Left="200" Canvas.Top="100" Width="32" Height="24" />
</Canvas>
</Viewbox>
返回过滤和/或排序数据。它们具有相同的结构。我无法以任何方式修改这些表格。
我目前使用Laravels以分页等方式运行其中一个表。
添加其他表时出现问题。我想做什么:
我必须要做的事情:
有没有一种好的,非黑客的方法呢?