에있는
이 태그는 실버 라이트에서 지원되지만 불행히도 WPF에서는이 태그가 빠져있는 것 같습니다. 이 프리즘 팀이 실수로 놓친 것이 있는지 확실하지 않습니다. 위의 태그에 가장 적합한 대안은 무엇입니까?
에있는
이 태그는 실버 라이트에서 지원되지만 불행히도 WPF에서는이 태그가 빠져있는 것 같습니다. 이 프리즘 팀이 실수로 놓친 것이 있는지 확실하지 않습니다. 위의 태그에 가장 적합한 대안은 무엇입니까?
기본적으로 나만의 것을 만들어야합니다. 그러나 이전에 발견 한 예가 있습니다. Prism의 상호 작용 클래스를 상당히 수정했기 때문에 ModalPopupAction이 필요한 것보다 약간 다를 수 있습니다. 대신이 링크를 확인하고 그의 예를 다운로드하십시오. 그것은 WPF에 대한 구현이있다!
Prism: InteractionRequest and PopupModalWindowAction for WPF applications
그리고 경우에 당신은 내 ModalPopupAction은 다음과 같습니다 (하지만 내 다른 클래스를 필요) ...
public class ModalPopupAction : TriggerAction<FrameworkElement>
{
public UserControl InteractionView
{
get { return (UserControl)GetValue(InteractionViewProperty); }
set { SetValue(InteractionViewProperty, value); }
}
// Using a DependencyProperty as the backing store for PopupDialog. This enables animation, styling, binding, etc...
public static readonly DependencyProperty InteractionViewProperty =
DependencyProperty.Register("InteractionView", typeof(UserControl), typeof(ModalPopupAction), new UIPropertyMetadata(null));
protected override void Invoke(object parameter)
{
InteractionRequestedEventArgs args = parameter as InteractionRequestedEventArgs;
if (args == null)
return;
// create the window
ModalPopupDialog dialog = new ModalPopupDialog();
dialog.Content = InteractionView;
// set the data context
dialog.DataContext = args.Interaction;
// handle finished event
EventHandler handler = null;
handler = (o, e) =>
{
dialog.Close();
args.Callback();
};
args.Interaction.Finished += handler;
// center window
DependencyObject current = AssociatedObject;
while (current != null)
{
if (current is Window)
break;
current = LogicalTreeHelper.GetParent(current);
}
if (current != null)
dialog.Owner = (current as Window);
dialog.ShowDialog();
dialog.Content = null;
dialog.DataContext = null;
args.Interaction.Finished -= handler;
}
}
고마워 @Alan 궁금했다. 도움이 필요한 것! – kuhajeyan
호기심에 빠진이 질문을 프리즘 팀이 의도적으로 남겨두고 있는지 궁금해하십니까? – kuhajeyan
@kbird "Silverlight의 경우 Prism 라이브러리는 PopupChildWindowAction 클래스를 제공합니다."라는 내용의 책이 의도적이라고 생각합니다. WPF 구현에서 제외하기로 결정한 이유가 확실하지 않습니다. – Alan