private void MenuProperties_Click(object sender, RoutedEventArgs e) { var props = new Properties(); props.Encoding = _encoding; props.TextSize = SB.TextLength; PropertiesWindow dlg = new PropertiesWindow(props); dlg.PG.GroupByCategory = false; dlg.PG.IsReadOnly = true; dlg.Owner = this; if (!dlg.ShowDialog().GetValueOrDefault()) return; _encoding = props.Encoding; }