Exemplo n.º 1
0
        private void AddKnownPlayerButton_Click(object sender, RoutedEventArgs e)
        {
            if (!(this.DataContext is SettingsManager context))
            {
                return;
            }

            var addDialog = new PlayerMarkerWindow
            {
                Top         = this.Top + 50,
                Left        = this.Left + 50,
                Owner       = this,
                DataContext = context.Settings.KnownPlayers
            };

            addDialog.ShowDialog();
        }
Exemplo n.º 2
0
        private void EditKnownPlayerButton_Click(object sender, RoutedEventArgs e)
        {
            if (!(this.DataContext is SettingsManager context))
            {
                return;
            }
            if (!(KnownPlayersListBox.SelectedItem is PlayerMarker selectedPlayer))
            {
                return;
            }

            var editDialog = new PlayerMarkerWindow(selectedPlayer)
            {
                Top         = this.Top + 50,
                Left        = this.Left + 50,
                Owner       = this,
                DataContext = context.Settings.KnownPlayers
            };

            editDialog.ShowDialog();
        }