2017-10-20 17 views
-5

나는이새로 추가 된 요소를 WPF의 StackPanel 상단에 표시하는 방법은 무엇입니까?

public void AddEvent(UserControl uc) 
{ 
    stackPanelMain.Children.Add(uc); 
} 

처럼 StackPanelUserControl를 추가하지만 그 순서를 변경하고 상단에 마지막으로 추가 된 요소를 표시하고 싶습니다.

의 일부 Dictionary<DateTime, UserControl>foreachstackPanelChildren 속성을 채우기 위해 가정 해 봅시다없이 할 수있는 방법이 있나요?

답변

-1

는 그래서이었다 쉽게 × 2 등 2 :

public void AddEvent(UserControl uc) 
{ 
    stackPanelMain.Children.Insert(0, uc); 
}