コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: RecepCil/Examples
 private void ShowLocation(ContentControl element)
 {
     var location = element.PointToScreen(new Point(0, 0));
     MessageBox.Show(string.Format(
                                   "{2}'s location is ({0}, {1})",
                                   location.X,
                                   location.Y,
                                   element.Content));
 }
        public void ShowExpCardCalculator(ContentControl sender)
        {
            if (ExpCardCalculatorViewModel.IsActive) return;

            var senderPosition = sender.PointToScreen(new Point()); // allows us to position the new window below the button we just clicked
            var settings = new WindowSettingsBuilder()
                .SizeToContent()
                .WithTopLeft(senderPosition.Y + sender.ActualHeight, senderPosition.X)
                .HideMaximizeButton()
                .HideMinimizeButton()
                .HideIcon()
                .Create();
            windowManager.ShowWindow(ExpCardCalculatorViewModel, null, settings);
        }