는, 지금까지 내가 말할 수있는, 그냥 일반 OLE 버그입니다. 절름발이입니다. 내가 찾은 유일한 일은 절름발이 다. 슈퍼처럼, 슈퍼 절름발이. 나는 더 나은 것이 있었으면 좋겠지 만, 나는 그렇지 않습니다. 어쨌든, 그리드의 크기를 조정하면 이상한 스크롤 아티팩트가 사라질 것이므로 레이아웃을 업데이트하기 위해 엔진을 트리거하는 코드를 작성했습니다.
Timer _timer;
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
_timer = new Timer(1000);
_timer.Elapsed += _timer_Elapsed;
_timer.Start();
}
void _timer_Elapsed(object sender, ElapsedEventArgs e)
{
//why the hell are we doing this?
//well, the stupid error adorners on the grid like to be mis-aligned
//forcing a layout to happen makes them not look off. lame, I know.
Dispatcher.Invoke(new Action(() =>
{
MainDataGrid.Margin = new Thickness(MainDataGrid.Margin.Left, MainDataGrid.Margin.Top, MainDataGrid.Margin.Right, MainDataGrid.Margin.Bottom + 1);
MainDataGrid.UpdateLayout();
MainDataGrid.Margin = new Thickness(MainDataGrid.Margin.Left, MainDataGrid.Margin.Top, MainDataGrid.Margin.Right, MainDataGrid.Margin.Bottom - 1);
MainDataGrid.UpdateLayout();
}));
}
스크린 샷과 코드를 게시 할 수 있습니까? WPF Snoop과 같은 도구를 사용하면 무슨 일이 일어나는지 파악할 수 있습니다. –
위대한 도구! 이제 저는이 객체를 어떤 유형의 객체인지 알아 내기 위해이 객체를 사용하고 있습니다! – DeveloperInToronto