/// <summary> /// Constructor /// </summary> /// <param name="viewModel"></param> /// <param name="hInfo"></param> public SurveyPopupWindow(SurveyPopupViewModel viewModel, HostControlInfo hInfo) { InitializeComponent(); if (viewModel != null) { surveyViewModel = viewModel; } DataContext = surveyViewModel; //Setting the host over which the popup will appear and the placement mode PlacementTarget = hInfo.HostUIElement; Placement = hInfo.PopupPlacement; //When setting a value for offset it will move the popup taking as a initial position the host control position in which the popup is shown HorizontalOffset = hInfo.HorizontalPopupOffSet; VerticalOffset = hInfo.VerticalPopupOffSet; }
protected override void CreatePopup() { var surveyPopupViewModel = new SurveyPopupViewModel(this); stepUIPopup = new SurveyPopupWindow(surveyPopupViewModel, HostPopupInfo); }