2014-01-19 2 views
3

편집 : 코드 팩의 소스를 수정하고 업데이트 된 NuGet 패키지 업로드 한TaskDialog 창 높이가 잘못

: dmex에

https://www.nuget.org/packages/WindowsAPICodePack-Shell/

감사합니다 버그 수정을위한 http://archive.msdn.microsoft.com/WindowsAPICodePack/WorkItem/View.aspx?WorkItemId=108

보시다시피, 문제가 해결되었습니다. D 및 Opened 이벤트의 성가신 구문을 사용 할 필요가 없습니다 :

enter image description here


아이콘을 지정하는 대화 상자 높이가 잘못을; 마지막 명령 링크는 완전히 볼 수 없습니다 :

enter image description here

이 문제를 해결하는 방법에 대한 아이디어가 있습니까? 이 대화 상자를 표시하기위한 사용

코드 :

var dialog = new TaskDialog 
{ 
    Caption = Title, 
    InstructionText = "Some files added are already in the collection.", 
    Text = "They have been skipped." 
}; 
dialog.Opened += (s1, e1) => { dialog.Icon = TaskDialogStandardIcon.Warning; }; 

var linkContinue = new TaskDialogCommandLink("Continue", "Continue", string.Empty); 
linkContinue.Click += (s2, e2) => 
{ 
    var s = (TaskDialogCommandLink)s2; 
    var taskDialog = (TaskDialog)(s.HostingDialog); 
    taskDialog.Close(); 
}; 
dialog.Controls.Add(linkContinue); 

var linkView = new TaskDialogCommandLink("View", "View these files", string.Empty); 
linkView.Click += (s3, e3) => 
{ 
    var s = (TaskDialogCommandLink)s3; 
    var taskDialog = (TaskDialog)(s.HostingDialog); 
    taskDialog.Close(); 
    var window1 = new Window1 { Text = files, Title = Title }; 
    window1.ShowDialog(); 
}; 
dialog.Controls.Add(linkView); 

dialog.Show(); 
+0

@Aybe ... 왜 API의 GetProperty (SystemProperties.System.Photo.DateTaken)가 문자열이나 DateTime을 반환하는지 알기 쉽게 설명합니다. 그것이 무엇을 반환하는지, 내가 이해할 수없는 것, DateTime – dinotom

+0

로 변환 할 수 없으며 어떤 라이브러리가 Window1 객체가 오는지 알 수 없습니다. 찾을 수없는 것 같습니다. – dinotom

답변

5

도 다시 한 번 .Opend에서 "InstructionText"를 지정하십시오 (뿐만 아니라 1.1.0.0에서 문제를 해결하는 것 같다).

 var dialog = new TaskDialog 
     { 
      Caption = Title, 
      InstructionText = "Some files added are already in the collection.", 
      Text = "They have been skipped." 
     }; 

     dialog.Opened += (s1, e1) => 
     { 
      dialog.Icon = TaskDialogStandardIcon.Warning; 
      dialog.InstructionText = dialog.InstructionText; // < seems to work 
     }; 
+0

실제로 라이브러리에 이러한 구문을 방지하는 버그가 있습니다. 아이콘이 표시되지 않으므로 열린 상태로 완료됩니다. – Aybe

+0

나는 지금 (VS2012) 그것을 시도했다 - 잘 작동하는 것 같다? – Nikolay

+0

API 코드 팩은 어디에서 받았습니까? 내 것은 Nuget 출신이다 (버전 1.1.0.0). – Aybe