Код: Выделить всё
....
**strong text**
_InitPos.X)
{
Canvas.SetLeft(rec, _InitPos.X);
rec.Width = currentPos.X - _InitPos.X;
}
else
{
Canvas.SetLeft(rec, currentPos.X);
rec.Width = _InitPos.X - currentPos.X;
}
// Y coordinates
if (currentPos.Y > _InitPos.Y)
{
Canvas.SetTop(rec, _InitPos.Y);
rec.Height = currentPos.Y - _InitPos.Y;
}
else
{
Canvas.SetTop(rec, currentPos.Y);
rec.Height = _InitPos.Y - currentPos.Y;
}
Limit.ReleaseMouseCapture();
}
Я пытался отобразить прямоугольники с помощью Container.Children.Add(rec);и результат отображается, но я не могу добавить прямоугольники в свой элемент управления.
Спасибо за помощь
Подробнее здесь: https://stackoverflow.com/questions/790 ... -sharp-wpf
Мобильная версия