private void SetProperties(GridPopUp control) { control.Items = ItemsSource; control.ShowRequiredIndicator = ShowRequiredIndicator; control.DisplayMemberPath = DisplayMemberPath; control.SelectedItem = EditValue; control.ShowSearch = ShowSearch; control.ShowTotalCount = ShowTotalCount; control.DataSource = DataSource; control.IsReadOnly = IsReadOnly; }
private void OpenGridPopUp() { var locationFromScreen = _border.PointToScreen(new Point(0, 0)); var source = PresentationSource.FromVisual(_border); var targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); var control = new GridPopUp(); SetProperties(control); var window = new PopUpWindow(); window.Top = targetPoints.Y; window.Left = targetPoints.X; window.Content = control; window.Closed += PopUpClosed; window.Show(); }