private void SaveStatsPreset()
            {
                var filename = string.IsNullOrEmpty(_statPresetFilename)
                             ? StatsManagerVM.GetPresetFilePath("mypreset.statspreset")
                             : _statPresetFilename;

                if (DialogManager.Instance.ShowSaveFileDialog(this.L("stat_comparer", "save_stat_preset_dialog_title"),
                                                              ref filename,
                                                              string.Format("{0}(*.statspreset)|*.statspreset",
                                                                            this.L("stat_comparer", "stat_preset_file_type_filter")),
                                                              defaultExtensionName: "statspreset") == true)
                {
                    try
                    {
                        using (var file = File.Create(filename))
                        {
                            var statKeys = this.SelectedStats.Select(s => s.Model.Key).ToArray();
                            this.CreateStatsPresetSerializer().WriteObject(file, statKeys);
                            _isStatPresetChanged = false;
                        }

                        _statPresetFilename = filename;
                    }
                    catch (Exception ex)
                    {
                        var message = this.L("stat_comparer", "save_stat_preset_failed_message", filename, ex.Message);
                        DialogManager.Instance.ShowMessageAsync(this.L("common", "error"), message);
                        this.LogError("failed to save stats preset from file '{0}': {1}", filename, ex.Message);
                    }
                }
            }
 public AvailableStatsDropHandlerImpl(StatsManagerVM owner)
 {
     _owner = owner;
 }
 public SelectedStatsDropHandlerImpl(StatsManagerVM owner)
 {
     _owner = owner;
 }