我使用ControlTemplate和GridViewRowPresenter的堆栈面板在WPF中实现了一个带有列的树视图.我按照这篇文章:http://blogs.msdn.com/b/atc_avalon_team/archive/2006/03/01/541206.aspx
它完美无缺!
但是,我希望在水平滚动时保持左列(带名称)可见.
这就像第一列上的microsoft excel上的'冻结窗格'.
一个想法,任何人?
谢谢弗雷德里克
我寻找这个结构的两个实例之间的相等.
public struct Serie<T>
{
T[] X;
double[] Y;
public Serie(T[] x, double[] y)
{
X = x;
Y = y;
}
public override bool Equals(object obj)
{
return obj is Serie<T> && this == (Serie<T>)obj;
}
public static bool operator ==(Serie<T> s1, Serie<T> s2)
{
return s1.X == s2.X && s1.Y == s2.Y;
}
public static bool operator !=(Serie<T> s1, Serie<T> s2)
{
return !(s1 == s2);
}
Run Code Online (Sandbox Code Playgroud)
这不起作用.我错过了什么?
double[] xa = { 2, 3 };
double[] ya = …Run Code Online (Sandbox Code Playgroud) 是否有可能提高这些linq请求的效率?我使用两个不同的循环...你能帮我优化这段代码吗?
double[] x = { 2, 3, 1, 5, 7, 2, 3 };
double[] y = { 1, 2, 3, 4, 5, 6, 7 };
IEnumerable<int> range = Enumerable.Range(0, x.Length);
double[] y_sorted = (from n in range orderby x[n] select y[n]).ToArray();
double[] x_sorted = (from n in range orderby x[n] select x[n]).ToArray();
Run Code Online (Sandbox Code Playgroud)
python中的这段代码就像你喜欢的那样:
x_index = argsort(x)
x_sorted = [x[i] for i in x_index]
y_sorted = [y[i] for i in x_index]
Run Code Online (Sandbox Code Playgroud)
你会注意到,在这个python代码中,我只使用一种.这不是c#代码的情况.
我们应该到最后:
x_sorted = { 1, 2, 2, 3, 3, …Run Code Online (Sandbox Code Playgroud)