Сколько лет учиться на программиста?
Дальше в WPF Grid и StackPanel:
private void Window_Loaded(object sender, RoutedEventArgs e){
StackPanel sp = new StackPanel();
for (int j = 0; j < 10; j++) sp.Children.Add(new TextBlock() { Text = "Item" + j});
this.Content = sp;
}
Только вот это StackPanel sp = new StackPanel();
в метод render() запихиваем.
Если рисовать хотите то так:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Globalization;
namespace WpfApplication2 {
public class MyCTL : UIElement {
public MyCTL() {}
protected override void OnRender(DrawingContext dc)
{
dc.DrawText(new FormattedText(headers.Caption, CultureInfo.GetCultureInfo("de-de"), FlowDirection.LeftToRight, new Typeface("Times New Roman"), 15, Brushes.Black), new Point(10f, 10f));
}
}
public partial class Window1 : Window {
public Window1() {
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e) {
MyCTL m = new MyCTL();
this.Content = m;
}
}
только запихиваете в OnRender
PS. для компактного кода, в предыдущем примере переделываем так:
foreach (var item in from head in headers join item in items on head.column_id equals item.column_id select new { subitem = item.subitem, x = head.x, y = item.row_id, Text = item.Text })